JSPM

@wyesoftware/dayjs-hebcal-plugin

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q35091F
  • License MIT

Hebcal plugin for dayjs

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-plugin
pnpm add dayjs @wyesoftware/dayjs-hebcal-plugin
yarn add dayjs @wyesoftware/dayjs-hebcal-plugin

Usage

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 false

function isHoliday()

Returns true if date is Hebrew holiday

dayjs().hebcal().isHoliday(); // () => boolean

function 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); // () => string

Supported 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