A lightweight TypeScript npm module to calculate German public holidays for each federal state – zero dependencies.
npm install feiertagejsInstall Feiertage.js with your preferred package manager:
npm install feiertagejsyarn add feiertagejspnpm add feiertagejsUsing Feiertage.js is this simple:
import { getHolidays, isHoliday, isSpecificHoliday } from 'feiertagejs';
// Ist heute ein Feiertag in Bayern?
const today = new Date();
const isTodayHoliday = isHoliday(today, 'BY');
// Alle Feiertage 2026 für Bayern
const holidays2026 = getHolidays('2026', 'BY');
// Ist Christi Himmelfahrt?
const isAscension = isSpecificHoliday(
today, 'CHRISTIHIMMELFAHRT', 'ALL'
);If you’re using dayjs, there’s a dedicated plugin: dayjs-feiertage. It uses Feiertage.js under the hood and adds holiday checks and yearly holiday lists to dayjs.
pnpm add dayjs-feiertage dayjsnpm install dayjs-feiertage dayjsyarn add dayjs-feiertage dayjsimport dayjs from "dayjs";
import dayjsFeiertage from "dayjs-feiertage";
// Extend dayjs with the plugin
dayjs.extend(dayjsFeiertage);
// Check if a date is a holiday
dayjs("2025-12-25").isHoliday("BUND"); // true
// Check if a date is a Sunday or holiday
dayjs("2025-12-25").isSunOrHoliday("BUND"); // true
// Get all holidays for a year
dayjs("2025-01-01").getHolidaysOfYear("BY"); // Holiday[]Check if a specific date is a holiday in a federal state.
import { isHoliday } from 'feiertagejs';
const date = new Date('2026-12-25');
isHoliday(date, 'BW');
// => trueGet all holidays for a year and region.
import { getHolidays } from 'feiertagejs';
const holidays = getHolidays('2026', 'BY');
holidays[0].name;
// => 'NEUJAHRSTAG'
holidays[0].translate('de');
// => 'Neujahrstag'Check if a date is a specific holiday.
import { isSpecificHoliday } from 'feiertagejs';
const date = new Date('2026-10-03');
isSpecificHoliday(
date,
'DEUTSCHEEINHEIT',
'ALL'
);
// => truePractical for business logic: Check both at once.
import { isSunOrHoliday } from 'feiertagejs';
const today = new Date();
if (isSunOrHoliday(today, 'NW')) {
console.log('Geschlossen!');
}The most important functions at a glance:
| Funktion | Beschreibung | Rückgabe |
|---|---|---|
isHoliday(date, region) | Checks if a date is a holiday | boolean |
getHolidays(year, region) | Returns all holidays of a year | Holiday[] |
getHolidayByDate(date, region) | Returns the holiday for a date | Holiday | undefined |
isSpecificHoliday(date, name, region) | Checks if a date is a specific holiday | boolean |
isSunOrHoliday(date, region) | Checks if a date is Sunday or holiday | boolean |
addTranslation(isoCode, translation) | Adds a new translation | void |
Feiertage.js supports all German federal states:
BWBaden-Württemberg
BYBavaria
BEBerlin
BBBrandenburg
HBBremen
HHHamburg
HEHesse
MVMecklenburg-Vorpommern
NILower Saxony
NWNorth Rhine-Westphalia
RPRhineland-Palatinate
SLSaarland
SNSaxony
STSaxony-Anhalt
SHSchleswig-Holstein
THThuringia
BUNDFederal holidays (valid in all states)
ALLAll holidays (valid in at least one state)
AUGSBURGCity of Augsburg (incl. Peace Festival)
Feiertage.js was developed by Simon Fakir and is maintained by the open-source community. The module is actively developed and production-ready.
Feiertage.js is free and open source. Try it out!
Want to use Feiertage.js in a business-critical system or need help with integration? Get in touch – we can support you with architecture design, integrations and reliable operations.