Documentation / @jalali-js/holidays
@jalali-js/holidays
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
npm install @jalali-js/holidaysCompatibility
| Item | Support |
|---|---|
| Region today | IR (Iran) |
| Reserved | AF, TJ |
| Dependencies | None at runtime |
| Lunar table | Shipped years (see pack yearRange) |
| Node | 22 and 24 (CI matrix) |
Quick start
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
| Export | Role |
|---|---|
isHoliday / holidaysOn | Query one day |
holidaysInMonth / Year | List in a span |
holidayDatesAround | Nearby holidays |
holidayName / Names | Localized labels |
holidayDayTip / Chrome | Tip text, aria label, blocked-day attrs |
resolveCalendarHolidays | Wire holidays into a calendar grid |
withHolidaysBlocked | Merge holiday blocks into selection rules |
IRAN_*_HOLIDAY_IDS | Fixed and lunar id lists |
Update lunar data: make update-holidays YEARS=next.
Options
| Option / prop | Values | Default | Notes |
|---|---|---|---|
region | 'IR' | 'AF' | 'TJ' | 'IR' | Query option on helpers |
showHolidays | boolean | false | Picker: mark days |
blockHolidays | boolean | false | Picker: 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.
Links
License
MIT
Interfaces
- CalendarHolidayOptions
- Holiday
- HolidayDateFields
- HolidayDayCell
- HolidayDayChrome
- HolidayDayTipOptions
- HolidayNames
- HolidayOccurrence
- HolidayQueryOptions
- HolidaySelectionRules
- RegionHolidayPack
- ResolvedCalendarHolidays
Type Aliases
Variables
- DEFAULT_HOLIDAY_REGION
- HOLIDAY_REGIONS
HOLIDAY_YEAR_RANGE- IRAN_FIXED_HOLIDAY_IDS
- IRAN_LUNAR_HOLIDAY_IDS
- SHIPPED_HOLIDAY_REGIONS