@jass75892/nanakshahi-calendar
v0.1.0
Published
Nanakshahi (Sikh) calendar for Node, React, React Native, Angular and the browser — dates, months, festivals and Gurpurabs in Punjabi, Hindi and Pinglish.
Maintainers
Readme
nanakshahi-calendar
Nanakshahi (Sikh) calendar for Node, React, React Native, Angular and the browser. Get Nanakshahi dates, months, weekdays, Gurpurabs, Shaheedi Dihade and Punjab festivals — in English, Punjabi (Gurmukhi), Hindi (Devanagari) and Pinglish (romanised Punjabi).
- 🧮 Custom, deterministic, timezone-safe date engine (no heavy runtime dependencies).
- 🌐 Every name and description in 4 languages.
- 🪔 Festivals including Bandi Chhorr Divas / Diwali and Hola Mohalla (auto-calculated).
- 📜 Rich detail: significance of each day, and biographies of key figures (Gurus, Maharaja Ranjit Singh, Baba Deep Singh, Bhagat Singh …).
- 🔭 Past, present and future — pass any date.
The engine is validated day-by-day against the authoritative Sikh calendar (2004–2100). See
doc/PROJECT_GUIDE.mdfor the full API and conventions.
Install
npm install @jass75892/nanakshahi-calendarUsage
import {
getNanakshahiDate,
getFestivalsForDate,
getUpcomingFestivals,
} from '@jass75892/nanakshahi-calendar'
// Today's Nanakshahi date in every language
const today = getNanakshahiDate('2026-07-04')
today.pretty // { en:'20 Harh 558', pa:'੨੦ ਹਾੜ ੫੫੮', hi:'२० हाड़ ५५८', pinglish:'20 Harh 558' }
today.weekday.pa // 'ਸ਼ਨੀਵਾਰ'
today.month_name.hi// 'हाड़'
// Festivals on a date
getFestivalsForDate('2024-11-01').map((f) => f.name.en) // ['Bandi Chhorr Divas / Diwali']
// Detail: significance + figure biography (birth AND death share one bio)
const gp = getFestivalsForDate('2026-01-05')[0]
gp.name.en // 'Parkash Sri Guru Gobind Singh Ji'
gp.description.pa // significance in Gurmukhi
gp.figure?.bio.en // biography of Guru Gobind Singh Ji
// Upcoming events (future / present / past — pass any date)
getUpcomingFestivals('2026-07-04', 5)CommonJS works too: const { getNanakshahiDate } = require('@jass75892/nanakshahi-calendar').
Development
npm install
npm test # vitest (cross-validated against the `nanakshahi` oracle)
npm run build # tsup → dist (ESM + CJS + .d.ts)
npm run gen:movable# regenerate the movable-festival date tableLicense
MIT. Festival dates are facts; descriptions and translations are authored for this package.
The dev-only nanakshahi and mhah-panchang packages (MPL-2.0) are used as a test oracle
and date generator and are not bundled at runtime.
