Skip to content

Documentation / @jalali-js/holidays

@jalali-js/holidays ​

npm versionLicense: MITDocs

Offline Iran (IR) public holiday data for jalali-js: fixed solar rules, lunar year tables, and picker helpers. Zero runtime dependencies. AF and TJ are reserved region codes.

Start here: Live demo · Documentation

npm ecosystem: jalali-js · @jalali-js/i18n · @jalali-js/nlp · @jalali-js/holidays · @jalali-js/react · @jalali-js/vue · @jalali-js/web · @jalali-js/ui-react · @jalali-js/ui-vue · @jalali-js/ui-web

Contents ​

Install ​

sh
npm install @jalali-js/holidays

Compatibility ​

ItemSupport
Region todayIR (Iran)
ReservedAF, TJ
DependenciesNone at runtime
Lunar tableShipped years (see pack yearRange)
Node22 and 24 (CI matrix)

Quick start ​

ts
import { isHoliday, holidaysOn, holidayName } from '@jalali-js/holidays';

const day = { year: 1403, month: 1, day: 1 };
isHoliday(day); // true on Nowruz
holidaysOn(day); // HolidayOccurrence[]
holidayName('nowruz', 'fa'); // 'نوروز'

In pickers, pass showHolidays, blockHolidays, and holidayRegion (default 'IR'). With showHolidays, hover or focus shows a day tip (data-jalali-calendar-tip). Blocked holidays append LocalePack.ui.closedDay from @jalali-js/i18n.

API ​

ExportRole
isHoliday / holidaysOnQuery one day
holidaysInMonth / YearList in a span
holidayDatesAroundNearby holidays
holidayName / NamesLocalized labels
holidayDayTip / ChromeTip text, aria label, blocked-day attrs
resolveCalendarHolidaysWire holidays into a calendar grid
withHolidaysBlockedMerge holiday blocks into selection rules
IRAN_*_HOLIDAY_IDSFixed and lunar id lists

Update lunar data: make update-holidays YEARS=next.

Options ​

Option / propValuesDefaultNotes
region'IR' | 'AF' | 'TJ''IR'Query option on helpers
showHolidaysbooleanfalsePicker: mark days
blockHolidaysbooleanfalsePicker: block selection
holidayRegion'IR' | 'AF' | 'TJ''IR'Picker: which pack

Guide: Holidays.

Theming ​

This package has no UI. Holiday marks use picker theme tokens such as --jalali-event-bg when a binding paints them.

License ​

MIT

Interfaces ​

Type Aliases ​

Variables ​

Functions ​