Skip to content

Nepal holidays ​

Introduction ​

@nepdatejs/holidays knows Nepal's fixed-date national days, and can load each year's official list for everything else. It works with @nepdatejs/core, and plugs into the calendar and pickers.

bash
npm install @nepdatejs/holidays
ts
import { adDate } from '@nepdatejs/core';
import { holidaysFor, holidaysOn, isHoliday } from '@nepdatejs/holidays';

holidaysFor(2083).length; // → 7
isHoliday(adDate(2026, 9, 19)); // → true
holidaysOn(adDate(2026, 9, 19))[0]?.name.en; // → 'Constitution Day'

What is included ​

DayBS dateObserved from
Nepali New Year1 Baisakh
Loktantra Day11 Baisakh2063
Republic Day15 Jestha2065
Constitution Day3 Asoj2072
Prithvi Jayanti (National Unity Day)27 Poush
Martyrs' Day16 Magh
Democracy Day7 Falgun2008

Festivals are not included

Dashain, Tihar, Chhath and other festivals follow the lunar calendar, so their BS dates change every year and can't be calculated. Whether a national day is a public holiday can also change by government notice. For leave and payroll, load each year's published list, as shown below.

Looking up holidays ​

For a year ​

holidaysFor takes a BS year and returns its holidays in date order:

ts
import { holidaysFor } from '@nepdatejs/holidays';

const [first] = holidaysFor(2083);

first?.id; // → 'new-year'
first?.name; // → { en: 'Nepali New Year', ne: 'नयाँ वर्ष' }
first?.type; // → 'national'

For a day ​

holidaysOn and isHoliday accept a date in either calendar:

ts
import { bsDate } from '@nepdatejs/core';
import { holidaysOn, isHoliday } from '@nepdatejs/holidays';

isHoliday(bsDate(2083, 6, 3)); // → true
isHoliday(bsDate(2083, 6, 4)); // → false
holidaysOn(bsDate(2083, 6, 4)); // → []

For a range ​

holidaysBetween crosses years, which is handy for fiscal-year reports:

ts
import { bsDate } from '@nepdatejs/core';
import { holidaysBetween } from '@nepdatejs/holidays';

holidaysBetween(bsDate(2083, 6, 1), bsDate(2083, 11, 30)).map((holiday) => holiday.id).length; // → 4

Filtering ​

Every lookup takes the same filter:

ts
import { holidaysFor } from '@nepdatejs/holidays';

holidaysFor(2083, { types: ['national'] }).length; // → 7
holidaysFor(2083, { includeFixed: false }); // → []
OptionDefaultMeaning
typesallOnly these kinds: national, festival, observance, custom
includeFixedtrueInclude the bundled national days

Names ​

ts
import { holidayName, holidaysFor } from '@nepdatejs/holidays';

const [first] = holidaysFor(2083);

first && holidayName(first, 'ne'); // → 'नयाँ वर्ष'

In the calendar and pickers ​

toCalendarHolidays gives you a function for the holidays option. Days turn red and screen readers hear the name:

tsx
import { toCalendarHolidays } from '@nepdatejs/holidays';
import { Calendar, DatePicker } from '@nepdatejs/react';

const holidays = toCalendarHolidays({ locale: 'ne' });

export function Schedule() {
  return (
    <>
      <DatePicker holidays={holidays} aria-label="Date" />
      <Calendar holidays={holidays} />
    </>
  );
}

It takes the same types and includeFixed filter, plus locale.

Adding your own ​

registerHolidays adds days for a year, such as school or company closures:

ts
import { holidaysFor, registerHolidays } from '@nepdatejs/holidays';

registerHolidays(2083, [
  {
    id: 'founders-day',
    date: '2083-05-10',
    name: { en: "Founders' Day", ne: 'संस्थापक दिवस' },
    type: 'custom',
  },
]);

holidaysFor(2083, { types: ['custom'] })[0]?.source; // → 'registered'

Loading a yearly list ​

Save each year's published list as JSON:

json
{
  "year": 2083,
  "source": "https://example.gov.np/notice-2083",
  "holidays": [
    {
      "id": "vijaya-dashami",
      "date": "2083-06-24",
      "name": { "en": "Vijaya Dashami", "ne": "विजया दशमी" },
      "type": "festival"
    }
  ]
}
FieldRule
yearThe BS year the list covers
sourceRequired: where the list comes from
idUnique in the file. Reuse a fixed day's ID, such as constitution-day, to replace it for that year
dateA BS date inside year, in ASCII or Devanagari digits
nameBoth en and ne
typenational, festival (the default), observance or custom

The dates above are examples only. Copy real dates from the published notice, and never estimate festival dates.

Then load it. The file is checked first:

ts
import { loadHolidayFile } from '@nepdatejs/holidays';

const response = await fetch('/holidays/2083.json');

loadHolidayFile(await response.json());

A bad file throws HolidayDataError, whose path shows where the problem is:

ts
import { HolidayDataError, parseHolidayFile } from '@nepdatejs/holidays';

try {
  parseHolidayFile({ year: 2083, source: 'notice', holidays: [{ id: '' }] });
} catch (error) {
  if (error instanceof HolidayDataError) {
    error.path; // → 'holidays[0].id'
  }
}

parseHolidayFile only checks a file. loadHolidayFile checks it and adds it.

Managing lists ​

ts
import { clearHolidays, registerHolidays, registeredYears } from '@nepdatejs/holidays';

registerHolidays(2083, []);
registeredYears(); // → [2083]

clearHolidays(2083);
registeredYears(); // → []

Call clearHolidays() with no year to remove every list.

Released under the MIT licence.