bizdays-toolkit 0.22.0 → 0.22.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/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.22.2] - 2026-10-27
8
+
9
+ ### Changed
10
+
11
+ - ガイド(英日)の「未確定の祝日」で、祝日の翌日・祝前日の規則が見る日を 0.22.1 で「隣の日(`skipWeekdays` があれば塊の全体)」としたのは実装と違っていたので、「隣の日。`skipWeekdays` があれば、そこから飛ばす曜日を越えて最も近い祝日まで」に直した(0.22.1 の節の「実装どおり」は誤り。塊の中で最も近い祝日より遠い日は見ないので、その日が未確定の祝日でも `unconfirmed-holiday` にならない。動作は変わらない)
12
+ - 型定義のコメント(`OnHolidayRule` の `"after-holiday"`)の「祝日でない翌日に振り替える」を「その日以降で最初の祝日でない日(土曜日のこともある)に振り替える」にした(0.22.1 でガイドを直した説明と揃える。`.js` は変わらない)
13
+ - `docs/migration.md`: 0.22.0 の `cycle` への書き換えの注意の「`openRecurring` の規則と重なる日は営業日になる」に、祝日ではその `openRecurring` の規則も `"over-holiday"` の場合だけであることを足した(祝日には `"over-holiday"` の休業の規則が、既定の `"under-holiday"` の `openRecurring` より先に決まる)。祝前日の行に、祝前日は祝日でないので祝日での順番の違いは関係しないことを足した
14
+ - 0.22.1 の節の補足: 言葉どおりの翌平日を `skipWeekdays` で書けると示したのはガイド(英日)だけ。README(英日)は「翌平日」を「次の祝日でない日」に置き換え、規則の表に「土曜日のこともある」を足した(`skipWeekdays` での書き方は示していない)。`scripts/bench.ts` のコメントと `test/recurring.test.ts` のテスト名の「翌平日」も直していた(どちらも公開物に含まれない)
15
+
16
+ ## [0.22.1] - 2026-10-27
17
+
18
+ ### Changed
19
+
20
+ - 祝日の識別子(`key`)の付け方の説明を、同梱の提供元に実際に付いている `key` と合わせた(公開物の動作・`key` は変わらない)。冠詞は先頭の "The" だけを除き、途中の冠詞は残す(`respect-for-the-aged`・`battle-of-the-boyne`)。例外は `new-year`・`boxing-day`・`labour-day`・`national-day` の 4 つ。規則は `docs/providers.md`(英日)にだけ書き、ガイド(英日)はそこを指す形にした(ガイド・`docs/providers.md`・決定の文書が、それぞれ別の不正確な規則を書いていた)
21
+ - README(英日)・ガイド(英日)の `onHolidayRule: "after-holiday"` の説明を「翌平日」「next weekday」から「次の祝日でない日(土曜日のこともある)」に改め、言葉どおりの翌平日は `skipWeekdays` で書けることを示した(振替先は decisions.md の 14 番のとおり「祝日でない日」で、金曜日の規則は金曜日が祝日のたびに土曜日に振り替わる。動作は変わらない)
22
+ - ガイド(英日)の「未確定の祝日」で、祝日の翌日・祝前日の規則が見る日を「隣の日」から「隣の日(`skipWeekdays` があれば塊の全体)」に改めた(実装どおり)
23
+ - ガイド(英日)の作成時間の具体値(開発用の機械での測定値)を「1 ミリ秒を大きく下回る」に改めた(機械に依存する値は照合できないため)
24
+ - `docs/migration.md`: 0.22.0 の `cycle`・祝前日の規則への書き換えに、判定の段階が変わる注意(`holidayPolicy: "open"` なら `onHolidayRule: "over-holiday"` を付ける、`openRecurring` の規則と重なる日は営業日になる、書き換えの前後で `daysBetween` を比べる)を足した
25
+ - `docs/decisions.md`: 46 番の `key` の付け方の規則を、自身の例(`respect-for-the-aged`)と矛盾しない形に改めた(「冠詞」→「先頭の冠詞」、例外を 4 つに整理)。14 番に、土曜日への振替が「年に 0〜1 回」なのは月曜日の規則の場合だけであることを追記した
26
+
7
27
  ## [0.22.0] - 2026-10-27
8
28
 
9
29
  ### Added
@@ -640,7 +660,9 @@
640
660
 
641
661
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
642
662
 
643
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.22.0...HEAD
663
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.22.2...HEAD
664
+ [0.22.2]: https://github.com/inohan77/bizdays-toolkit/compare/v0.22.1...v0.22.2
665
+ [0.22.1]: https://github.com/inohan77/bizdays-toolkit/compare/v0.22.0...v0.22.1
644
666
  [0.22.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.4...v0.22.0
645
667
  [0.21.4]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.3...v0.21.4
646
668
  [0.21.3]: https://github.com/inohan77/bizdays-toolkit/compare/v0.21.2...v0.21.3
package/README.md CHANGED
@@ -21,7 +21,7 @@ A business-day calendar that combines public holidays with company or store clos
21
21
 
22
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; for 1974–2011 the Royal Proclamations in The Gazette, and from 2000 the government lists of the time; England, Wales, Scotland and Northern Ireland), France (data.gouv.fr; metropolitan France and Alsace-Moselle, verified for 2006–2031) 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
- - **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", "the last weekday before a bank holiday", shift cycles such as four days on and two days off, each with its own behaviour on holidays and an optional effective period
24
+ - **Recurring rules**: "closed on the 3rd Wednesday", "every other Wednesday", "stocktaking on the last day of the month", "closed on Mondays, moved to the next non-holiday when Monday is a holiday", "the day after (or before) a holiday", "the last weekday before a bank holiday", shift cycles such as four days on and two days off, 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
27
  - **Lightweight, zero dependencies, time-zone safe**: about 11.5 KB min+gzip (about 13.2 KB with Japanese holidays, about 13.6 KB with UK bank holidays, about 12.4 KB with French holidays, about 12.4 KB with Singapore holidays; measured for 0.22.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
@@ -84,7 +84,7 @@ A calendar is built from the holiday provider and your closures: `closedWeekdays
84
84
  | `{ businessDayOfMonth: -1 }`, `{ businessDayOfMonth: 5 }` | The last business day of the month, the 5th business day |
85
85
  | `{ holiday: true, kinds: ["substitute"] }` | Holidays, optionally narrowed by kind or by key (`keys: ["vernal-equinox"]`) |
86
86
  | `{ dayAfterHoliday: true }`, `{ dayBeforeHoliday: true }` | The day after (or before) a holiday or a run of holidays |
87
- | `onHolidayRule: "after-holiday"` | "Closed on Mondays, or the next weekday when Monday is a holiday" (museum rule) |
87
+ | `onHolidayRule: "after-holiday"` | "Closed on Mondays, or the next non-holiday if a holiday" (can be a Saturday) |
88
88
  | `skipWeekdays: [0, 6]` | With `"after-holiday"`: also skip weekends ("June 15, or the next business day") |
89
89
  | `effectiveFrom`, `effectiveTo` | The period the rule is in effect |
90
90
 
@@ -63,7 +63,7 @@ export type Month = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
63
63
  * 繰り返しの規則が祝日に当たったときの扱い。
64
64
  * - "under-holiday": 祝日の下。祝日の扱いに従う(既定)
65
65
  * - "over-holiday": 祝日の上。祝日でも当てはめる
66
- * - "after-holiday": 祝日の後。祝日には当てはめず、祝日でない翌日に振り替える
66
+ * - "after-holiday": 祝日の後。祝日には当てはめず、その日以降で最初の祝日でない日(土曜日のこともある)に振り替える
67
67
  * @public
68
68
  */
69
69
  export type OnHolidayRule = "under-holiday" | "over-holiday" | "after-holiday";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
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 and The Gazette; French public holidays (metropole, Alsace-Moselle) verified against data.gouv.fr; Singapore public holidays verified against data.gov.sg. / 祝日と営業日のカレンダー(タイムゾーン対応・日本の祝日は内閣府、英国の bank holidays は GOV.UK と The Gazette、フランスの祝日は data.gouv.fr、シンガポールの祝日は data.gov.sg のデータで全日照合)",
5
5
  "keywords": [
6
6
  "bank-holidays",