@fineanmol/public-holidays 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @fineanmol/public-holidays
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Public holiday lookups for Germany (Berlin) and India, with no runtime dependencies. Works in Node and any bundler that handles ES modules.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Also pairs with [`@fineanmol/holiday-optimizer`](https://www.npmjs.com/package/@fineanmol/holiday-optimizer) if you want the full PTO planning tool.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -33,13 +33,13 @@ import {
|
|
|
33
33
|
} from "@fineanmol/public-holidays";
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
- **`listRegions()`** — `{ id, name }[]`
|
|
37
|
-
- **`holidaysInYear(regionId, year)`** — `{ date
|
|
38
|
-
- **`isHoliday(date, regionId)`** — `
|
|
39
|
-
- **`holidayOn(date, regionId)`** — holiday object
|
|
40
|
-
- **`nextHoliday(fromDate, regionId)`** —
|
|
41
|
-
- **`previousHoliday(fromDate, regionId)`** — last holiday
|
|
42
|
-
- **`toISODate(date)`** —
|
|
36
|
+
- **`listRegions()`** — returns `{ id, name }[]` for all supported regions
|
|
37
|
+
- **`holidaysInYear(regionId, year)`** — all holidays for that region/year as `{ date, name }[]`
|
|
38
|
+
- **`isHoliday(date, regionId)`** — `true`/`false`; `date` can be a `Date` or `'YYYY-MM-DD'` string
|
|
39
|
+
- **`holidayOn(date, regionId)`** — the holiday object if that day is one, otherwise `null`
|
|
40
|
+
- **`nextHoliday(fromDate, regionId)`** — next holiday on or after that date
|
|
41
|
+
- **`previousHoliday(fromDate, regionId)`** — last holiday on or before that date
|
|
42
|
+
- **`toISODate(date)`** — converts a `Date` to `'YYYY-MM-DD'` using the local calendar day
|
|
43
43
|
|
|
44
44
|
## Example
|
|
45
45
|
|
|
@@ -56,9 +56,9 @@ nextHoliday("2026-10-02", "germany-berlin");
|
|
|
56
56
|
// → { date: '2026-10-03', name: 'Tag der Deutschen Einheit' }
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## Note
|
|
60
60
|
|
|
61
|
-
Holiday rules change. This
|
|
61
|
+
Holiday rules change year to year. This is good for apps and scheduling — don't rely on it for payroll or compliance without checking official sources.
|
|
62
62
|
|
|
63
63
|
## License
|
|
64
64
|
|
package/package.json
CHANGED