Package Exports
- @wyesoftware/dayjs-hebcal-plugin
Readme
dayjs-hebcal-plugin
Hebcal plugin for Dayjs
dayjs().hebcal().format();Getting Started
Installation
bun add dayjs @wyesoftware/dayjs-hebcal-pluginpnpm add dayjs @wyesoftware/dayjs-hebcal-pluginyarn add dayjs @wyesoftware/dayjs-hebcal-pluginUsage
import dayjs from "dayjs";
import hebcal from "@wyesoftware/dayjs-hebcal-plugin";
dayjs.extend(hebcal);
console.log(dayjs().hebcal().format());API
Init
[Optional] use the Israeli schedule for holidays
dayjs().hebcal(israeli?: boolean); // default falsefunction isHoliday()
Returns true if date is Hebrew holiday
dayjs().hebcal().isHoliday(); // () => booleanfunction getHolidays()
Returns an array of holidays on this date
dayjs().hebcal().getHolidays(); // () => string[]function format()
Returns formatted Hebrew date (default: "DDD MMM YYY")
dayjs().hebcal().format(formatStr?: string); // () => stringSupported Formats
| Format | Output | Description |
|---|---|---|
| DD | 1-30 | Day of month |
| DDD | כ״ה | Day of month in Hebrew letters |
| MM | 1-13 | Month of year |
| MMM | סיון | Month of year in Hebrew |
| YY | 5774 | Year |
| YYY | תשפ״ה | Year in Hebrew letters |