Skip to content

Commit

Permalink
Remove names from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzyCzech committed Apr 28, 2024
1 parent 6fa3d6c commit c332547
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 143 deletions.
1 change: 0 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from './easter.js';
export * from './holidays.js';
export * from './fathers-day.js';
export * from './mothers-day.js';
export * from './names.js';
export * from './significant.js';
export * from './shops.js';
export * from './get-meta.js';
19 changes: 0 additions & 19 deletions lib/names.ts

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@
],
"dependencies": {
"easter-date": "0.0.7",
"luxon": "^3.4.4",
"namedays-cs": "^0.0.6"
"luxon": "^3.4.4"
},
"devDependencies": {
"@types/luxon": "^3.4.2",
"@types/node": "^20.12.7",
"ava": "^6.1.2",
"np": "^10.0.5",
"tsx": "^4.7.2",
"tsx": "^4.7.3",
"typescript": "^5.4.5",
"xo": "^0.58.0"
},
Expand Down
121 changes: 54 additions & 67 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Last Commit](https://img.shields.io/github/last-commit/OzzyCzech/holidays-cs?style=for-the-badge)](https://github.com/OzzyCzech/holidays-cs/commits/main)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/OzzyCzech/holidays-cs/main.yml?style=for-the-badge)](https://github.com/OzzyCzech/holidays-cs/actions)

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

## Functions

Expand All @@ -21,25 +21,68 @@ 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.

## Name days
## 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

You can get the name day for a given date:
// 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.

### Easter date
Expand Down Expand Up @@ -115,50 +158,6 @@ import {getEasterDayName} from 'holidays-cs';
getEasterDayName(DateTime.fromISO('2024-03-29')); // Velký pátek
```

## 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

Father's Day is celebrated on the **third Sunday in June**.
Expand All @@ -177,21 +176,9 @@ isMothersDay(DateTime.fromISO('2024-05-12')); // true
getMothersDay(2024).toISODate(); // 2024-05-12
```

## 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
- [Online calendar](https://calendar.center/) for verifying the data
- [Easter dates calculation](https://github.com/paulzag/ZagZ-iCalendars) for the Easter dates
Expand Down
44 changes: 0 additions & 44 deletions test/names.ts

This file was deleted.

13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3527,11 +3527,6 @@ [email protected]:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e"
integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==

namedays-cs@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/namedays-cs/-/namedays-cs-0.0.6.tgz#eb61518a8fd0dc465a08821f3d0951a18805e8ff"
integrity sha512-/Zt/7TVYOXgVFIm9btdafaJ8hqXA3C4+eyiLJxVCA203I3sgZgeeIVY/Dk2cjMrfbov0LvoOyE2gGJlybbC0Rw==

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down Expand Up @@ -4846,10 +4841,10 @@ tslib@^2.1.0, tslib@^2.6.2:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

tsx@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.7.2.tgz#a108b1a6e16876cd4c9a4b4ba263f2a07f9cf562"
integrity sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==
tsx@^4.7.3:
version "4.7.3"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.7.3.tgz#c32f3f5cb928708a5c6becf617e432b395999242"
integrity sha512-+fQnMqIp/jxZEXLcj6WzYy9FhcS5/Dfk8y4AtzJ6ejKcKqmfTF8Gso/jtrzDggCF2zTU20gJa6n8XqPYwDAUYQ==
dependencies:
esbuild "~0.19.10"
get-tsconfig "^4.7.2"
Expand Down

0 comments on commit c332547

Please sign in to comment.