Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
holidays-cs
Advanced tools
Public holidays, Easter, name days and important days in the Czech Republic.
Public holidays, Easter, name days and important days in the Czech Republic.
All functions are available in the main module. You can import them like this:
import * as holidays from 'holidays-cs';
Luxon is used for date manipulation.
You can pass a Date
object or a DateTime
object to the functions.
Responses are always DateTime
objects. If you need a Date
object,
you can use the response.toJSDate()
method.
You can get the name day for a given date:
import {DateTime} from 'luxon';
import {getNameDay, getNameDayArray} from 'holidays-cs';
// String of name days
getNameDay(DateTime.fromISO('2024-12-24')); // Adam a Eva
getNameDay(DateTime.fromISO('2024-12-24'), ', '); // Adam, Eva
// Array of name days
getNameDayArray(DateTime.fromISO('2024-12-24')); // ['Adam', 'Eva']
Easter Monday (Velikonoční pondělí) and Good Friday (Velký pátek) are public holidays in the Czech Republic.
Library can calculate the Easter date for a given year (it's Sunday):
import {getEaster} from 'holidays-cs';
getEaster(2024).toISODate(); // 2024-03-31
getEaster(2025).toISODate(); // 2025-04-20
import {getGoodFriday, getHolySaturday, getEasterSunday, getEaster, getEasterMonday} from 'holidays-cs';
getGoodFriday(2024).toISODate(); // 2024-03-29
getHolySaturday(2024).toISODate(); // 2024-03-30
// Easter Sunday and Easter are the same
getEasterSunday(2024).toISODate(); // 2024-03-31
getEaster(2024).toISODate(); // 2024-03-31
getEasterMonday(2024).toISODate(); // 2024-04-01
You can also check if a given date is Good Friday, Holy Saturday, Easter Sunday or Easter Monday:
import {isGoodFriday, isHolySaturday, isEasterSunday, isEasterMonday} from 'holidays-cs';
import {DateTime} from 'luxon';
// 29. march 2024 - Good Friday
isGoodFriday(DateTime.fromISO('2024-03-29')); // true
// 30. march 2024 - Holy Saturday
isHolySaturday(DateTime.fromISO('2024-03-30')); // true
// 31. march 2024 - Easter Sunday
isEasterSunday(DateTime.fromISO('2024-03-31')); // true
// 1. april 2024 - Easter Monday
isEasterMonday(DateTime.fromISO('2024-04-01')); // true
You can also check if given date is part of the Holy Week. Holy Week is the week before Easter plus Easter Monday. Starts with Palm Sunday and ends with Easter Monday.
import {isHolyWeek, getHollyWeekInterval} from 'holidays-cs';
// 29. march 2024
isHolyWeek(DateTime.fromISO('2024-03-29')); // true it's Good Friday
// Get the Holy Week interval
getHollyWeekInterval(2024) // {start: DateTime, end: DateTime}
You can also get the name of the day in the Holy Week:
import {DateTime} from 'luxon';
import {getEasterDayName} from 'holidays-cs';
getEasterDayName(DateTime.fromISO('2024-03-29')); // Velký pátek
import {DateTime} from 'luxon';
import {isPublicHoliday, getPublicHoliday} from 'holidays-cs';
// 1. january
isPublicHoliday(DateTime.fromISO('2024-01-01')); // true
// 2. january
isPublicHoliday(DateTime.fromISO('2024-01-02')); // false
// 17. november
isPublicHoliday(DateTime.fromISO('2024-11-17')); // true
getPublicHoliday(DateTime.fromISO('2024-11-17')); // Den boje za svobodu a demokracii (1939 a 1989)
You can get all public holidays for a given year:
import {getPublicHolidaysList} from 'holidays-cs';
getPublicHolidaysList(2024); // returns Map with all 13 holidays
In the Czech Republic, shops are closed on some public holidays.
import {DateTime} from 'luxon';
import {areShopsOpen, getShopsStatus} from 'holidays-cs';
// 24. december 2024
areShopsOpen(DateTime.fromISO('2024-12-24')); // true
// 25. december 2024
getShopsStatus(DateTime.fromISO('2024-12-25')); // otevřeno do 12:00
// New Year's Day 2025
areShopsOpen(DateTime.fromISO('2025-01-01')); // false
getShopsStatus(DateTime.fromISO('2025-01-01')); // zavřeno
Father's Day is celebrated on the third Sunday in June. Mother's Day is celebrated on the second Sunday in May.
import {DateTime} from 'luxon';
import {isFathersDay, getFathersDay, isMothersDay, getMothersDay} from 'holidays-cs';
// 16. june 2024
isFathersDay(DateTime.fromISO('2024-06-16')); // true
getFathersDay(2024).toISODate(); // 2024-06-16
// 12. may 2024
isMothersDay(DateTime.fromISO('2024-05-12')); // true
getMothersDay(2024).toISODate(); // 2024-05-12
MIT
FAQs
Public holidays, Easter, name days and important days in the Czech Republic.
We found that holidays-cs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.