Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

holidays-cs

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

holidays-cs - npm Package Compare versions

Comparing version 0.1.10 to 1.0.0

9

package.json
{
"name": "holidays-cs",
"version": "0.1.10",
"version": "1.0.0",
"author": "Roman Ožana <roman@ozana.cz> (https://ozana.cz)",

@@ -37,5 +37,4 @@ "repository": "OzzyCzech/holidays-cs",

"dependencies": {
"easter-date": "0.0.7",
"luxon": "^3.4.4",
"namedays-cs": "^0.0.6"
"easter-date": "0.0.8",
"luxon": "^3.4.4"
},

@@ -47,3 +46,3 @@ "devDependencies": {

"np": "^10.0.5",
"tsx": "^4.7.2",
"tsx": "^4.7.3",
"typescript": "^5.4.5",

@@ -50,0 +49,0 @@ "xo": "^0.58.0"

@@ -9,3 +9,3 @@ # Holidays (cs)

Public holidays, Easter, name days and important days in the Czech Republic.
Public holidays and significant days in the Czech Republic.

@@ -25,21 +25,64 @@ ## Functions

## Name days
## Czech public holidays
You can get the name day for a given date:
```javascript
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:
```javascript
import {getPublicHolidaysList} from 'holidays-cs';
getPublicHolidaysList(2024); // returns Map with all 13 holidays
```
### Shops status
In the Czech Republic, shops are closed on some public holidays.
```javascript
import {DateTime} from 'luxon';
import {getNameDay, getNameDayArray} from 'holidays-cs';
import {areShopsOpen, getShopsStatus} from 'holidays-cs';
// String of name days
getNameDay(DateTime.fromISO('2024-12-24')); // Adam a Eva
getNameDay(DateTime.fromISO('2024-12-24'), ', '); // Adam, Eva
// 24. december 2024
areShopsOpen(DateTime.fromISO('2024-12-24')); // true
// Array of name days
getNameDayArray(DateTime.fromISO('2024-12-24')); // ['Adam', 'Eva']
// 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
```
## Czech significant days
Significant days are not public holidays, but they are important in the Czech Republic.
```javascript
import {DateTime} from 'luxon';
import {isSignificantDay, getSignificantDay} from 'holidays-cs';
// 16. jan 2024
isSignificantDay(DateTime.fromISO('2024-01-16')); // true
getSignificantDay(DateTime.fromISO('2024-01-16')).name; // Den památky Jana Palacha
```
Visit the [significant days](https://cs.wikipedia.org/wiki/%C4%8Cesk%C3%BD_st%C3%A1tn%C3%AD_sv%C3%A1tek) page for more information.
## Easter
**Easter Monday** (Velikonoční pondělí) and **Good Friday** (Velký pátek)
**Easter Monday** (_Velikonoční pondělí_) and **Good Friday** (_Velký pátek_)
are public holidays in the Czech Republic.

@@ -120,46 +163,2 @@

## Czech public holidays
```javascript
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:
```javascript
import {getPublicHolidaysList} from 'holidays-cs';
getPublicHolidaysList(2024); // returns Map with all 13 holidays
```
### Shops status
In the Czech Republic, shops are closed on some public holidays.
```javascript
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 and Mother's Day

@@ -183,17 +182,5 @@

## Czech significant days
```javascript
import {DateTime} from 'luxon';
import {isSignificantDay, getSignificantDay} from 'holidays-cs';
// 16. jan 2024
isSignificantDay(DateTime.fromISO('2024-01-16')); // true
getSignificantDay(DateTime.fromISO('2024-01-16')).name; // Den památky Jana Palacha
```
Visit the [significant days](https://cs.wikipedia.org/wiki/%C4%8Cesk%C3%BD_st%C3%A1tn%C3%AD_sv%C3%A1tek) page for more information.
## Credits
- [Public holidays and significant days](https://cs.wikipedia.org/wiki/%C4%8Cesk%C3%BD_st%C3%A1tn%C3%AD_sv%C3%A1tek)
- [date-holidays](https://github.com/commenthol/date-holidays) library for inspiration

@@ -200,0 +187,0 @@ - [Online calendar](https://calendar.center/) for verifying the data

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc