bizdays-toolkit 0.19.0 → 0.20.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.20.0] - 2026-10-25
8
+
9
+ ### 移行
10
+
11
+ 動作が変わる既存の API はない。サブパス `bizdays-toolkit/fr` が増える。版ごとの作業は [docs/migration.md](./docs/migration.md) にまとめた。
12
+
13
+ ### Added
14
+
15
+ - フランスの祝日の提供元 `bizdays-toolkit/fr` を追加した。`metropole`(ID `FR`。労働法典 L3133-1 の 11 日)と `alsaceMoselle`(ID `FR-AM`。Vendredi saint と 12 月 26 日が加わる)で、タイムゾーンは `Europe/Paris`、対応年は 2000〜2099 年。固定日と復活祭からの日数で計算し、振替はない。名称は data.gouv.fr の表記(フランス語)、`nameEn` は英訳、`key` は英語名から(`labour-day`・`pentecost-monday` など 13 個。型 `KnownFrHolidayKey`)。2 つの祝日が同じ日に当たる年(2008 年・2059 年の Ascension)は復活祭の側の名称で 1 件。祝日は法令で定まり年ごとの告示がないので、すべて `confirmed: true` で `confirmedThrough` は持たない。型 `FrHoliday`・`FrHolidayKind`・`KnownFrHolidayKind` を追加した
16
+ - data.gouv.fr の「Jours fériés en France」(DINUM。Métropole と Alsace-Moselle のゾーンの JSON)の 2006〜2031 年のすべての日付と名称に一致することをテストで確かめる(`test/fixtures/datagouv-jours-feries.json`)
17
+
18
+ ### Changed
19
+
20
+ - README: 提供元の表にフランスを足し、min+gzip のサイズの値を 0.20.0 で測り直した(ルート 10.0 → 11.0 KB。0.18.0・0.19.0 の追加分を含む)
21
+ - `docs/guide.md`・`docs/guide.ja.md`: 「French public holidays / フランスの祝日」の節と、識別子の表のフランスの行を足した
22
+ - `RELEASING.md`: 「フランスのデータの更新」の節を足し、区分の表の「規則で計算する提供元」にフランスを含めた
23
+ - `docs/decisions.md`: 48 番(フランスの提供元と、4 か国目の選び方の基準)を追加した
24
+ - `package.json`: `exports` に `./fr`、keywords に `france` を足した
25
+
26
+ ### 開発
27
+
28
+ - 監視のワークフロー `data-watch.yml` に data.gouv.fr の照合を足した(issue のラベル `datagouv-data`。ハートビートは 4 つの照合がすべて動いたときだけ)。`scripts/verify-datagouv.ts` を英国・シンガポール・日本と同じ形で追加した(`pnpm verify:datagouv`)
29
+ - テスト: `test/fr-rules.test.ts`・`test/fr-datagouv.test.ts` を追加し、`test/holiday-key.test.ts`・ESM/CJS/ブラウザー/workerd の確認・利用者の型チェックにフランスを足した
30
+ - サイズの上限(`size-limits.json`)に `./fr` 6,500(測定 5,404)を足した(gzip)
31
+
7
32
  ## [0.19.0] - 2026-10-25
8
33
 
9
34
  ### 移行
@@ -518,7 +543,8 @@
518
543
 
519
544
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
520
545
 
521
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.19.0...HEAD
546
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.20.0...HEAD
547
+ [0.20.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.19.0...v0.20.0
522
548
  [0.19.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.18.0...v0.19.0
523
549
  [0.18.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.17.1...v0.18.0
524
550
  [0.17.1]: https://github.com/inohan77/bizdays-toolkit/compare/v0.17.0...v0.17.1
package/README.md CHANGED
@@ -19,12 +19,12 @@
19
19
 
20
20
  A business-day calendar that combines public holidays with company or store closures.
21
21
 
22
- - **Holidays verified day by day against official data**: Japan (Cabinet Office, 1955 to the latest year in the Official Gazette), the UK (GOV.UK; England, Wales, Scotland and Northern Ireland, 2012 onwards) and Singapore (Ministry of Manpower on data.gov.sg, 2020 onwards). Every date is checked in the tests, differences are watched daily and shipped as patch versions
22
+ - **Holidays verified day by day against official data**: Japan (Cabinet Office, 1955 to the latest year in the Official Gazette), France (data.gouv.fr; metropolitan France and Alsace-Moselle, verified for 2006–2031), the UK (GOV.UK; England, Wales, Scotland and Northern Ireland, 2012 onwards) and Singapore (Ministry of Manpower on data.gov.sg, 2020 onwards). Every date is checked in the tests, differences are watched daily and shipped as patch versions
23
23
  - **Business-day arithmetic**: closed weekdays, annual closures (across the new year too), specific closed and open dates and holidays combine into "N business days later", "next business day after the cutoff" and month-based due dates with the four adjustment conventions used in finance
24
24
  - **Recurring rules**: "closed on the 3rd Wednesday", "every other Wednesday", "stocktaking on the last day of the month", "closed on Mondays, or the next weekday when Monday is a holiday", "the day after (or before) a holiday", each with its own behaviour on holidays and an optional effective period
25
25
  - **Day-by-day values and combined calendars**: store hours that change by weekday, holiday and date; a business-day calendar made from such a schedule; and the days on which all (or any) of several calendars are open
26
26
  - **Option diagnostics**: `bizdays-toolkit/diagnose` lists rules that never apply, rules that are shadowed or redundant, rules that have ended, typos in option names and options with no business day at all, without throwing. One line in a test keeps options honest
27
- - **Lightweight, zero dependencies, time-zone safe**: about 10.0 KB min+gzip (about 11.8 KB with Japanese holidays, about 11.7 KB with UK bank holidays, about 10.9 KB with Singapore holidays; measured for 0.17.0). Standard JavaScript and `Intl` only, ESM with bundled types; tested on Node.js, Chrome, Firefox, Edge, Safari, Cloudflare Workers, Bun and Deno. Instants such as `Date` are converted to a civil date in the calendar's time zone before evaluation
27
+ - **Lightweight, zero dependencies, time-zone safe**: about 11.0 KB min+gzip (about 12.9 KB with Japanese holidays, about 11.9 KB with French holidays, about 12.8 KB with UK bank holidays, about 11.9 KB with Singapore holidays; measured for 0.20.0). Standard JavaScript and `Intl` only, ESM with bundled types; tested on Node.js, Chrome, Firefox, Edge, Safari, Cloudflare Workers, Bun and Deno. Instants such as `Date` are converted to a civil date in the calendar's time zone before evaluation
28
28
  - **Extensible to other countries and regions**: holiday providers are pluggable through the `HolidayProvider` interface, and `bizdays-toolkit/provider` exposes the calendar arithmetic (nth weekday of a month, Easter, substitute days for holidays on a weekend) that most countries' holidays are built from
29
29
 
30
30
  ## Installation
@@ -60,11 +60,12 @@ The [guide](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/guide.md)
60
60
 
61
61
  ## What you can do
62
62
 
63
- ### Holidays of Japan, the UK and Singapore
63
+ ### Holidays of Japan, France, the UK and Singapore
64
64
 
65
65
  | Provider | Subpath | Time zone | Supported years | Verified against |
66
66
  | ------------------------------------------------- | -------------------- | ---------------- | --------------- | -------------------------------------- |
67
67
  | `jp` | `bizdays-toolkit/jp` | `Asia/Tokyo` | 1955–2099 | Cabinet Office "National Holidays" CSV |
68
+ | `metropole`, `alsaceMoselle` | `bizdays-toolkit/fr` | `Europe/Paris` | 2000–2099 | data.gouv.fr "Jours fériés en France" |
68
69
  | `england`, `wales`, `scotland`, `northernIreland` | `bizdays-toolkit/uk` | `Europe/London` | 2012–2099 | GOV.UK bank holidays |
69
70
  | `sg` | `bizdays-toolkit/sg` | `Asia/Singapore` | 2020–2027 | data.gov.sg (Ministry of Manpower) |
70
71
 
@@ -128,7 +129,7 @@ A holiday provider is an object with `id`, `timeZone`, `supportedYears` and `hol
128
129
 
129
130
  Versioning follows [Semantic Versioning](https://semver.org/). See [RELEASING.md](https://github.com/inohan77/bizdays-toolkit/blob/main/RELEASING.md) (Japanese) for details.
130
131
 
131
- - Official data updates (new, moved and one-off holidays by law, Official Gazette or proclamation, fixed equinox days in Japan, newly published years on GOV.UK, newly gazetted years and revised dates in Singapore) are released as **patch** versions, so they reach you with either `^` or `~`
132
+ - Official data updates (new, moved and one-off holidays by law, Official Gazette or proclamation, fixed equinox days in Japan, newly published years on GOV.UK, newly gazetted years and revised dates in Singapore, changes to the French Labour Code) are released as **patch** versions, so they reach you with either `^` or `~`
132
133
  - To freeze the holiday results, pin an exact version (for example `"bizdays-toolkit": "0.8.0"`)
133
134
  - The reflected data is shown by the provider's `dataVersion` (for Japan, the year and month of the Official Gazette reflected; for the UK and Singapore, the year and month of the GOV.UK or data.gov.sg data reflected) and `confirmedThrough` (`jp.dataVersion`, `england.confirmedThrough` and so on). The module-level constants `dataVersion` and `confirmedThrough` in `bizdays-toolkit/jp` and `bizdays-toolkit/uk` are deprecated since 0.12.0 and will be removed in 1.0.0
134
135
  - Before 1.0.0, minor versions may contain breaking changes. What you need to change when moving between minor versions is listed in the [migration guide](https://github.com/inohan77/bizdays-toolkit/blob/main/docs/migration.md) (Japanese) and in the "移行" (migration) part of each version in the CHANGELOG
@@ -142,7 +143,9 @@ UK bank holidays are verified with the GOV.UK bank holidays data (<https://www.g
142
143
 
143
144
  Singapore public holidays are verified with the "Singapore Public Holidays" collection published by the Ministry of Manpower on data.gov.sg (<https://data.gov.sg/collections/691/view>), with the Ministry's press releases as the authority where the two differ (the verification data is a test fixture only; not included in the package).
144
145
 
145
- Contains public sector information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/), and data from data.gov.sg made available under the [Singapore Open Data Licence](https://data.gov.sg/open-data-licence).
146
+ French public holidays are verified with the "Jours fériés en France" dataset published by DINUM on data.gouv.fr (<https://www.data.gouv.fr/datasets/jours-feries-en-france>, JSON exports for the Métropole and Alsace-Moselle zones; the verification data is a test fixture only; not included in the package).
147
+
148
+ Contains public sector information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/), data from data.gov.sg made available under the [Singapore Open Data Licence](https://data.gov.sg/open-data-licence), and data from data.gouv.fr made available under the [Licence Ouverte / Open Licence 2.0](https://www.etalab.gouv.fr/licence-ouverte-open-licence).
146
149
 
147
150
  ## License
148
151
 
@@ -0,0 +1,35 @@
1
+ /**
2
+ * フランスの祝日(jours fériés)。本土(metropole)と Alsace-Moselle の 2 つの提供元。
3
+ *
4
+ * 労働法典 L3133-1 が定める 11 日(固定日 8 日と復活祭から決まる 3 日)を規則で計算し、Alsace-Moselle には地方法の
5
+ * Vendredi saint と 12 月 26 日が加わる。振替はない。data.gouv.fr の「Jours fériés en France」(DINUM)の JSON と全日照合している。
6
+ *
7
+ * @example
8
+ * import { createCalendar } from "bizdays-toolkit";
9
+ * import { metropole } from "bizdays-toolkit/fr";
10
+ * const paris = createCalendar({ holidays: metropole, closedWeekdays: [0, 6] });
11
+ *
12
+ * @example Lundi de Pentecôte を「連帯の日」として出勤日にする企業(法律上は祝日のまま。既定の扱いの例外として書く)
13
+ * createCalendar({ holidays: metropole, closedWeekdays: [0, 6],
14
+ * openRecurring: [{ holiday: true, keys: ["pentecost-monday"], name: "Journée de solidarité" }] });
15
+ */
16
+ import type { Holiday, HolidayProvider } from "../core/types.ts";
17
+ import { type FrHolidayKind } from "./rules.ts";
18
+ export type { FrHolidayKind, KnownFrHolidayKey, KnownFrHolidayKind } from "./rules.ts";
19
+ /**
20
+ * フランスの祝日。
21
+ * @public
22
+ */
23
+ export type FrHoliday = Holiday<FrHolidayKind>;
24
+ /**
25
+ * フランス本土(および data.gouv.fr の「Métropole」ゾーンに従う地域)の祝日の提供元。ID は FR、タイムゾーンは Europe/Paris。
26
+ * 対応年は 2000〜2099 年で、祝日は法令で定まり年ごとの告示はないので、すべて confirmed: true(confirmedThrough は持たない)。
27
+ * @public
28
+ */
29
+ export declare const metropole: HolidayProvider<FrHolidayKind>;
30
+ /**
31
+ * Alsace-Moselle(Bas-Rhin・Haut-Rhin・Moselle の 3 県。ISO 3166-2 に 1 つのコードがないので、このライブラリの ID は FR-AM)の
32
+ * 祝日の提供元。本土の 11 日に Vendredi saint(kind "regular"、key "good-friday")と 12 月 26 日("saint-stephens")が加わる。
33
+ * @public
34
+ */
35
+ export declare const alsaceMoselle: HolidayProvider<FrHolidayKind>;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * フランスの祝日(jours fériés)。本土(metropole)と Alsace-Moselle の 2 つの提供元。
3
+ *
4
+ * 労働法典 L3133-1 が定める 11 日(固定日 8 日と復活祭から決まる 3 日)を規則で計算し、Alsace-Moselle には地方法の
5
+ * Vendredi saint と 12 月 26 日が加わる。振替はない。data.gouv.fr の「Jours fériés en France」(DINUM)の JSON と全日照合している。
6
+ *
7
+ * @example
8
+ * import { createCalendar } from "bizdays-toolkit";
9
+ * import { metropole } from "bizdays-toolkit/fr";
10
+ * const paris = createCalendar({ holidays: metropole, closedWeekdays: [0, 6] });
11
+ *
12
+ * @example Lundi de Pentecôte を「連帯の日」として出勤日にする企業(法律上は祝日のまま。既定の扱いの例外として書く)
13
+ * createCalendar({ holidays: metropole, closedWeekdays: [0, 6],
14
+ * openRecurring: [{ holiday: true, keys: ["pentecost-monday"], name: "Journée de solidarité" }] });
15
+ */
16
+ import { DATA_VERSION, SUPPORTED_YEARS, computeFrHolidays, } from "./rules.js";
17
+ function provider(id, zone) {
18
+ const cache = new Map();
19
+ return Object.freeze({
20
+ id,
21
+ timeZone: "Europe/Paris",
22
+ supportedYears: SUPPORTED_YEARS,
23
+ dataVersion: DATA_VERSION,
24
+ holidaysInYear(year) {
25
+ let list = cache.get(year);
26
+ if (!list) {
27
+ list = Object.freeze(computeFrHolidays(zone, year));
28
+ cache.set(year, list);
29
+ }
30
+ return list;
31
+ },
32
+ });
33
+ }
34
+ /**
35
+ * フランス本土(および data.gouv.fr の「Métropole」ゾーンに従う地域)の祝日の提供元。ID は FR、タイムゾーンは Europe/Paris。
36
+ * 対応年は 2000〜2099 年で、祝日は法令で定まり年ごとの告示はないので、すべて confirmed: true(confirmedThrough は持たない)。
37
+ * @public
38
+ */
39
+ export const metropole = provider("FR", "metropole");
40
+ /**
41
+ * Alsace-Moselle(Bas-Rhin・Haut-Rhin・Moselle の 3 県。ISO 3166-2 に 1 つのコードがないので、このライブラリの ID は FR-AM)の
42
+ * 祝日の提供元。本土の 11 日に Vendredi saint(kind "regular"、key "good-friday")と 12 月 26 日("saint-stephens")が加わる。
43
+ * @public
44
+ */
45
+ export const alsaceMoselle = provider("FR-AM", "alsace-moselle");
@@ -0,0 +1,47 @@
1
+ /**
2
+ * フランスの祝日(jours fériés。労働法典 L3133-1 の 11 日と、Alsace-Moselle の 2 日)の計算。
3
+ *
4
+ * - 固定日の祝日(1/1・5/1・5/8・7/14・8/15・11/1・11/11・12/25。Alsace-Moselle は 12/26 も)と、
5
+ * 復活祭から決まる祝日(Lundi de Pâques = +1 日、Ascension = +39 日、Lundi de Pentecôte = +50 日。
6
+ * Alsace-Moselle は Vendredi saint = −2 日も)を規則で計算する。振替はない
7
+ * - 2 つの祝日が同じ日に当たる年(復活祭が 3 月 23 日なら 5 月 1 日 = Ascension(2008 年)、3 月 30 日なら 5 月 8 日 = Ascension(2059 年))は、
8
+ * 復活祭から決まる祝日の名称・識別子で 1 件にする
9
+ * (data.gouv.fr の JSON と同じ扱い。提供元は 1 日に 1 件を返す契約のため)
10
+ * - 名称は data.gouv.fr の表記(フランス語)。nameEn はライブラリの英訳
11
+ * - 識別子(key)は英語名から 1 つずつ(KnownFrHolidayKey)
12
+ *
13
+ * 対応年のうち data.gouv.fr が公開している範囲(過去 20 年・未来 5 年)のすべての日付と名称が一致することを、
14
+ * テスト用フィクスチャ(test/fixtures/datagouv-jours-feries.json)で検証している。祝日は法令で定まり年ごとの告示はないので、
15
+ * 対応年はすべて confirmed: true(法改正があれば労働法典の改正として反映する)。
16
+ */
17
+ import type { Holiday } from "../core/types.ts";
18
+ /**
19
+ * フランスの祝日の種別(既知の値)。
20
+ * @public
21
+ */
22
+ export type KnownFrHolidayKind =
23
+ /** 労働法典・地方法で定まる祝日(振替・臨時の祝日はない) */
24
+ "regular";
25
+ /**
26
+ * フランスの祝日の種別。将来の版で値が増えることがあるので、分岐では「その他」も扱うこと。
27
+ * すべての値を網羅したことを型で確かめたい場合は KnownFrHolidayKind を使う。
28
+ * @public
29
+ */
30
+ export type FrHolidayKind = KnownFrHolidayKind | (string & {});
31
+ /**
32
+ * フランスの祝日の識別子(Holiday.key。既知の値)。英語名から 1 つずつ。
33
+ * 規則の keys に書くときの補完に使う(型は開いているので他の文字列も通る)。
34
+ * @beta
35
+ */
36
+ export type KnownFrHolidayKey = "new-year" | "easter-monday" | "labour-day" | "victory-in-europe" | "ascension" | "pentecost-monday" | "bastille" | "assumption" | "all-saints" | "armistice" | "christmas" | "good-friday" | "saint-stephens";
37
+ /** @internal 地域(data.gouv.fr のゾーン) */
38
+ export type FrZone = "metropole" | "alsace-moselle";
39
+ /** @internal 対応年 */
40
+ export declare const SUPPORTED_YEARS: Readonly<{
41
+ from: 2000;
42
+ to: 2099;
43
+ }>;
44
+ /** @internal 反映済みの data.gouv.fr のデータの年月(2006〜2031 年の公開) */
45
+ export declare const DATA_VERSION = "2026-10";
46
+ /** @internal その年・地域の祝日(日付順) */
47
+ export declare function computeFrHolidays(zone: FrZone, year: number): Holiday<FrHolidayKind>[];
@@ -0,0 +1,77 @@
1
+ /**
2
+ * フランスの祝日(jours fériés。労働法典 L3133-1 の 11 日と、Alsace-Moselle の 2 日)の計算。
3
+ *
4
+ * - 固定日の祝日(1/1・5/1・5/8・7/14・8/15・11/1・11/11・12/25。Alsace-Moselle は 12/26 も)と、
5
+ * 復活祭から決まる祝日(Lundi de Pâques = +1 日、Ascension = +39 日、Lundi de Pentecôte = +50 日。
6
+ * Alsace-Moselle は Vendredi saint = −2 日も)を規則で計算する。振替はない
7
+ * - 2 つの祝日が同じ日に当たる年(復活祭が 3 月 23 日なら 5 月 1 日 = Ascension(2008 年)、3 月 30 日なら 5 月 8 日 = Ascension(2059 年))は、
8
+ * 復活祭から決まる祝日の名称・識別子で 1 件にする
9
+ * (data.gouv.fr の JSON と同じ扱い。提供元は 1 日に 1 件を返す契約のため)
10
+ * - 名称は data.gouv.fr の表記(フランス語)。nameEn はライブラリの英訳
11
+ * - 識別子(key)は英語名から 1 つずつ(KnownFrHolidayKey)
12
+ *
13
+ * 対応年のうち data.gouv.fr が公開している範囲(過去 20 年・未来 5 年)のすべての日付と名称が一致することを、
14
+ * テスト用フィクスチャ(test/fixtures/datagouv-jours-feries.json)で検証している。祝日は法令で定まり年ごとの告示はないので、
15
+ * 対応年はすべて confirmed: true(法改正があれば労働法典の改正として反映する)。
16
+ */
17
+ import { addDays, easterSunday, formatDate } from "../core/date.js";
18
+ import { rangeError } from "../core/errors.js";
19
+ /** @internal 対応年 */
20
+ export const SUPPORTED_YEARS = Object.freeze({ from: 2000, to: 2099 });
21
+ /** @internal 反映済みの data.gouv.fr のデータの年月(2006〜2031 年の公開) */
22
+ export const DATA_VERSION = "2026-10";
23
+ /** 固定日の祝日 [月, 日, 名称, 英語名, 識別子] */
24
+ const FIXED = [
25
+ [1, 1, "1er janvier", "New Year’s Day", "new-year"],
26
+ [5, 1, "1er mai", "Labour Day", "labour-day"],
27
+ [5, 8, "8 mai", "Victory in Europe Day", "victory-in-europe"],
28
+ [7, 14, "14 juillet", "Bastille Day", "bastille"],
29
+ [8, 15, "Assomption", "Assumption", "assumption"],
30
+ [11, 1, "Toussaint", "All Saints’ Day", "all-saints"],
31
+ [11, 11, "11 novembre", "Armistice Day", "armistice"],
32
+ [12, 25, "Jour de Noël", "Christmas Day", "christmas"],
33
+ ];
34
+ const FIXED_ALSACE_MOSELLE = [[12, 26, "2ème jour de Noël", "Saint Stephen’s Day", "saint-stephens"]];
35
+ /** 復活祭から決まる祝日 [日数差, 名称, 英語名, 識別子] */
36
+ const EASTER_BASED = [
37
+ [1, "Lundi de Pâques", "Easter Monday", "easter-monday"],
38
+ [39, "Ascension", "Ascension Day", "ascension"],
39
+ [50, "Lundi de Pentecôte", "Pentecost Monday", "pentecost-monday"],
40
+ ];
41
+ const EASTER_BASED_ALSACE_MOSELLE = [[-2, "Vendredi saint", "Good Friday", "good-friday"]];
42
+ /** @internal その年・地域の祝日(日付順) */
43
+ export function computeFrHolidays(zone, year) {
44
+ if (!Number.isInteger(year) || year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
45
+ throw rangeError("out-of-range", `French public holidays are supported for ${SUPPORTED_YEARS.from}-${SUPPORTED_YEARS.to}; requested ${year}`);
46
+ }
47
+ const alsaceMoselle = zone === "alsace-moselle";
48
+ const byDate = new Map();
49
+ for (const [month, day, name, nameEn, key] of alsaceMoselle
50
+ ? [...FIXED, ...FIXED_ALSACE_MOSELLE]
51
+ : FIXED) {
52
+ byDate.set(formatDate(year, month, day), {
53
+ date: formatDate(year, month, day),
54
+ name,
55
+ nameEn,
56
+ key,
57
+ });
58
+ }
59
+ // 復活祭から決まる祝日が固定日と同じ日に当たる年は、復活祭の側で上書きする(data.gouv.fr の JSON と同じ)
60
+ const easter = easterSunday(year);
61
+ for (const [offset, name, nameEn, key] of alsaceMoselle
62
+ ? [...EASTER_BASED_ALSACE_MOSELLE, ...EASTER_BASED]
63
+ : EASTER_BASED) {
64
+ const date = addDays(easter, offset);
65
+ byDate.set(date, { date, name, nameEn, key });
66
+ }
67
+ return [...byDate.values()]
68
+ .sort((a, b) => (a.date < b.date ? -1 : 1))
69
+ .map((e) => Object.freeze({
70
+ date: e.date,
71
+ name: e.name,
72
+ nameEn: e.nameEn,
73
+ kind: "regular",
74
+ confirmed: true,
75
+ key: e.key,
76
+ }));
77
+ }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.19.0",
4
- "description": "Holidays, business-day calendar and day-by-day schedules (e.g. store hours) with time zone support. Japanese holidays verified against the Cabinet Office data; UK bank holidays (England, Wales, Scotland, Northern Ireland) verified against GOV.UK; Singapore public holidays verified against data.gov.sg. / 祝日と営業日のカレンダー(タイムゾーン対応・日本の祝日は内閣府、英国の bank holidays は GOV.UK、シンガポールの祝日は data.gov.sg のデータで全日照合)",
3
+ "version": "0.20.0",
4
+ "description": "Holidays, business-day calendar and day-by-day schedules (e.g. store hours) with time zone support. Japanese holidays verified against the Cabinet Office data; UK bank holidays (England, Wales, Scotland, Northern Ireland) verified against GOV.UK; Singapore public holidays verified against data.gov.sg; French public holidays (metropole, Alsace-Moselle) verified against data.gouv.fr. / 祝日と営業日のカレンダー(タイムゾーン対応・日本の祝日は内閣府、英国の bank holidays は GOV.UK、シンガポールの祝日は data.gov.sg、フランスの祝日は data.gouv.fr のデータで全日照合)",
5
5
  "keywords": [
6
6
  "bank-holidays",
7
7
  "bizdays",
8
8
  "business-day",
9
9
  "business-days",
10
10
  "calendar",
11
+ "france",
11
12
  "holiday",
12
13
  "holidays",
13
14
  "japan",
@@ -51,6 +52,10 @@
51
52
  "types": "./dist/sg/index.d.ts",
52
53
  "default": "./dist/sg/index.js"
53
54
  },
55
+ "./fr": {
56
+ "types": "./dist/fr/index.d.ts",
57
+ "default": "./dist/fr/index.js"
58
+ },
54
59
  "./diagnose": {
55
60
  "types": "./dist/diagnose/index.d.ts",
56
61
  "default": "./dist/diagnose/index.js"
@@ -75,6 +80,7 @@
75
80
  "verify:cao": "node scripts/verify-cao.ts",
76
81
  "verify:govuk": "node scripts/verify-govuk.ts",
77
82
  "verify:datagovsg": "node scripts/verify-datagovsg.ts",
83
+ "verify:datagouv": "node scripts/verify-datagouv.ts",
78
84
  "prepublishOnly": "pnpm check",
79
85
  "release-notes": "node scripts/release-notes.ts",
80
86
  "api:update": "pnpm build && node scripts/api-report.ts --update"