holidays-cs
Advanced tools
Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "holidays-cs", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"author": "Roman Ožana <roman@ozana.cz> (https://ozana.cz)", | ||
@@ -42,7 +42,7 @@ "repository": "OzzyCzech/holidays-cs", | ||
"@types/luxon": "^3.4.2", | ||
"@types/node": "^20.14.2", | ||
"@types/node": "^20.14.9", | ||
"ava": "^6.1.2", | ||
"np": "^10.0.5", | ||
"tsx": "^4.12.0", | ||
"typescript": "^5.4.5", | ||
"np": "^10.0.6", | ||
"tsx": "^4.15.7", | ||
"typescript": "^5.5.2", | ||
"xo": "^0.58.0" | ||
@@ -49,0 +49,0 @@ }, |
@@ -161,2 +161,49 @@ # Holidays (cs) | ||
## Get day metadata | ||
You can get metadata for a given date: | ||
```javascript | ||
import {DateTime} from 'luxon'; | ||
import {getDayMeta} from 'holidays-cs'; | ||
const meta = getDayMeta(DateTime.fromISO('2024-05-15')); | ||
meta.isPublicHoliday; // false ... | ||
``` | ||
The metadata object looks like this: | ||
```typescript | ||
export type SignificantDay = { | ||
name: string; | ||
description: string; | ||
year?: number; | ||
}; | ||
export type EasterMetadata = { | ||
name: string | undefined; | ||
isGoodFriday: boolean; | ||
isHolySaturday: boolean; | ||
ieEasterSunday: boolean; | ||
isEasterMonday: boolean; | ||
}; | ||
export type DayMetadata = { | ||
// Significant days metadata | ||
isSignificantDay: boolean; | ||
significantDay?: SignificantDay; | ||
// Public holidays metadata | ||
isPublicHoliday: boolean; | ||
publicHoliday?: string | undefined; | ||
// Easter metadata | ||
isHolyWeek: boolean; | ||
easter?: EasterMetadata | undefined; | ||
// Shops metadata | ||
shops: {areOpen: boolean; status: string}; | ||
}; | ||
``` | ||
## Credits | ||
@@ -168,2 +215,2 @@ | ||
MIT | ||
[MIT](./LICENSE) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24625
214