bizdays-toolkit 0.31.0 → 0.31.1

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
@@ -6,6 +6,19 @@ Entries from 0.31.0 are in English. Earlier entries remain in Japanese (their **
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.31.1] - 2026-11-08
10
+
11
+ This version fixes behaviour that did not match the documentation and corrects the documentation. The results of valid calendars and schedules do not change.
12
+
13
+ ### Fixed
14
+
15
+ - Option diagnostics: `expired` (with `asOf`) was reported for a rule with `holidayOverlapPolicy: "after-holiday"` whose last day was moved past `effectiveTo` onto or after `asOf`, with a message saying that the rule no longer affects results (for example, a Monday rule ending on a Monday holiday still closes the Tuesday after). Such a rule is now `expired` only once more than 31 days have passed since `effectiveTo` (31 days is the furthest a day can be moved). Likewise, with a rule for the nth business day of the month or week counted on the calendar itself, a specific date or an annual date that ended could still move that nth business day later in its month or week; such an item is now `expired` only after the end of its month (with a monthly rule) or six days after its end (with a weekly rule). Fewer `expired` may be reported
16
+ - Date-time strings with an offset were read with the runtime's `Date.parse`, which differs between runtimes for forms that ECMAScript leaves to the implementation: Firefox and Safari threw `invalid-time` for a lowercase `t` or `z` (such as `"2026-11-22t15:30:00z"`), which the documented pattern accepts. The instant is now computed from the parts of the string, so every runtime gives the same result (fractions of up to 9 digits too)
17
+ - `diffBusinessDays` returned `-0` when `from` was after `to` and there was no business day between them; it now returns `0` (combined calendars and calendars made from a schedule too)
18
+ - Wrong arguments threw a `TypeError` without `code` instead of a `RangeError` with `code: "invalid-argument"`: `today` given something other than a `Date`, `businessDayOnOrAfter` given options that are not an object, and `createCalendarFromSchedule` given a schedule that is not an object or options that are not an object (these options were silently ignored before). Error messages for a Symbol or a BigInt argument no longer fail while being built (they threw a `TypeError` without `code`)
19
+ - Error messages: an hour of 24 is shown as written ("24:00", not "24:0"); a date-time string with seconds of 60 or more is reported as an invalid date-time string, like other malformed strings (the code is unchanged); the bundled providers' `holidaysInYear` given a year that is not an integer says so instead of reporting the year as out of range (the code is unchanged); `dueDate` and `combineCalendars` given options that are not an object say so (the codes are unchanged). Values in messages are written in one way: numbers as written (`NaN`, `Infinity`), strings in quotes, objects such as a `Date` or a `Map` by their kind, Symbols and BigInts readable
20
+ - Documentation: the `cutoff` TSDoc named the error class as `Error` (it is a `RangeError`); the guide and `KnownErrorCode` now mention that dates are limited to the years 1000–9999 (`out-of-range` outside them, also with `outOfRangePolicy: "ignore"`)
21
+
9
22
  ## [0.31.0] - 2026-11-08
10
23
 
11
24
  This version rebuilds the `redundant` diagnostic so that the reported rules can be removed all together, narrows the days the diagnostics cannot judge, and brings in the changes postponed in 0.30.x that throw where nothing was thrown before or narrow a type (the return value of `isOpen`, the error classes, the frozen result of `withSubstituteDays`). It also adds the search for closed days.
@@ -842,7 +855,8 @@ This version rebuilds the `redundant` diagnostic so that the reported rules can
842
855
 
843
856
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
844
857
 
845
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.31.0...HEAD
858
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.31.1...HEAD
859
+ [0.31.1]: https://github.com/inohan77/bizdays-toolkit/compare/v0.31.0...v0.31.1
846
860
  [0.31.0]: https://github.com/inohan77/bizdays-toolkit/compare/v0.30.9...v0.31.0
847
861
  [0.30.9]: https://github.com/inohan77/bizdays-toolkit/compare/v0.30.8...v0.30.9
848
862
  [0.30.8]: https://github.com/inohan77/bizdays-toolkit/compare/v0.30.7...v0.30.8
package/README.md CHANGED
@@ -23,7 +23,7 @@ A business-day calendar that combines public holidays with company or store clos
23
23
  - **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
24
24
  - **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
25
25
  - **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
26
- - **Lightweight, zero dependencies, time-zone safe**: about 13.3 KB min+gzip (about 15.1 KB with Japanese holidays, about 15.4 KB with UK bank holidays, about 14.2 KB with French holidays, about 14.2 KB with Singapore holidays; measured for 0.31.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
26
+ - **Lightweight, zero dependencies, time-zone safe**: about 13.6 KB min+gzip (about 15.4 KB with Japanese holidays, about 15.8 KB with UK bank holidays, about 14.5 KB with French holidays, about 14.6 KB with Singapore holidays; measured for 0.31.1). 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
27
  - **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
28
28
 
29
29
  ## Installation
@@ -162,7 +162,7 @@ export interface BusinessDayOnOrAfterOptions {
162
162
  * 締め時刻 "HH:mm" または "HH:mm:ss"(カレンダーのタイムゾーン)。
163
163
  * 入力の時刻は分の精度(秒を切り捨てた分)で、その分の始まりと比べる("14:00:30" なら 14:00 の入力は締めの前、14:01 は後)。
164
164
  * 入力の時刻がこの時刻以降なら、その日は対象にしない。時刻を持たない入力(暦日の文字列・Temporal の PlainDate など)
165
- * と組み合わせると code: "invalid-argument" の Error(締め時刻が黙って無視されるのを防ぐため)
165
+ * と組み合わせると code: "invalid-argument" の RangeError(締め時刻が黙って無視されるのを防ぐため)
166
166
  */
167
167
  readonly cutoff?: string;
168
168
  }
@@ -1,5 +1,5 @@
1
1
  import { addDays, lengthOfMonth, formatDate, fromDayNumber, toDayNumber, } from "./date.js";
2
- import { checkUnknownKeys, internalError, IssueCollector, rangeError, withoutUndefined, } from "./errors.js";
2
+ import { checkUnknownKeys, internalError, IssueCollector, describeValue, rangeError, withoutUndefined, } from "./errors.js";
3
3
  import { renameKeys, writtenKey } from "./renamed.js";
4
4
  import { parseTimeOfDaySeconds, toCivil } from "./input.js";
5
5
  import { checkClosingDay, closingDayIn, closingMonth as calendarClosingMonth, dayOfMonth, formatMonth, isDayOfMonthValue, parseMonth, shiftMonth, } from "./month.js";
@@ -211,7 +211,7 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
211
211
  }
212
212
  function nthOfMonth(month, n) {
213
213
  if (!Number.isInteger(n) || n === 0) {
214
- throw rangeError("invalid-argument", `n must be a non-zero integer: ${n}`);
214
+ throw rangeError("invalid-argument", `n must be a non-zero integer: ${describeValue(n)}`);
215
215
  }
216
216
  const days = businessDaysOfMonth(month);
217
217
  const found = n > 0 ? days[n - 1] : days[days.length + n];
@@ -244,11 +244,12 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
244
244
  previousBusinessDay: (input) => search(addDays(dateOf(input), -1), -1),
245
245
  nextClosedDay: (input) => search(addDays(dateOf(input), 1), 1, false),
246
246
  previousClosedDay: (input) => search(addDays(dateOf(input), -1), -1, false),
247
- businessDayOnOrAfter(input, opts = {}) {
247
+ businessDayOnOrAfter(input, options) {
248
+ const opts = optionsObject(options, "businessDayOnOrAfter options");
248
249
  const civil = toCivil(input, lookup.timeZone);
249
250
  let start = civil.date;
250
- if (opts.cutoff !== undefined) {
251
- const cutoff = parseTimeOfDaySeconds(opts.cutoff);
251
+ if (opts["cutoff"] !== undefined) {
252
+ const cutoff = parseTimeOfDaySeconds(opts["cutoff"]);
252
253
  if (civil.minutes === null) {
253
254
  throw rangeError("invalid-argument", "cutoff requires an input with a time of day (a Date, a date-time string or a Temporal value with a time); a date-only input would silently ignore the cutoff");
254
255
  }
@@ -260,7 +261,7 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
260
261
  businessDayOnOrBefore: (input) => search(dateOf(input), -1),
261
262
  addBusinessDays(input, n) {
262
263
  if (!Number.isInteger(n))
263
- throw rangeError("invalid-argument", `n must be an integer: ${n}`);
264
+ throw rangeError("invalid-argument", `n must be an integer: ${describeValue(n)}`);
264
265
  let date = dateOf(input);
265
266
  if (n === 0)
266
267
  return search(date, 1);
@@ -273,7 +274,7 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
273
274
  diffBusinessDays(from, to) {
274
275
  const a = toDayNumber(dateOf(from));
275
276
  const b = toDayNumber(dateOf(to));
276
- return a <= b ? countOpen(a, b) : -countOpen(b, a);
277
+ return a <= b ? countOpen(a, b) : 0 - countOpen(b, a);
277
278
  },
278
279
  businessDatesBetween(from, to) {
279
280
  const a = dateOf(from);
@@ -307,10 +308,8 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
307
308
  return Object.freeze({ from, to });
308
309
  },
309
310
  dueDate(month, options) {
310
- const o = isPlainObject(options)
311
- ? withoutUndefined(renameKeys("throw", ["dueDate"], "", options))
312
- : undefined;
313
- const day = o?.["dayOfMonth"];
311
+ const o = optionsObject(options, "dueDate options", (v) => renameKeys("throw", ["dueDate"], "", v), true);
312
+ const day = o["dayOfMonth"];
314
313
  if (!isDayOfMonthValue(day)) {
315
314
  throw rangeError("invalid-argument", `dayOfMonth must be an integer from 1 to 31, or -1 (last day): ${String(day)}`);
316
315
  }
@@ -322,6 +321,15 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
322
321
  return Object.freeze(calendar);
323
322
  }
324
323
  const isPlainObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
324
+ const isOptionsObject = (v) => isPlainObject(v) && Object.prototype.toString.call(v) === "[object Object]";
325
+ function optionsObject(options, what, rename = (v) => v, required = false, code = "invalid-argument") {
326
+ if (options === undefined && !required)
327
+ return {};
328
+ if (!isOptionsObject(options)) {
329
+ throw rangeError(code, `${what} must be an object: ${describeValue(options)}`);
330
+ }
331
+ return withoutUndefined(rename(options));
332
+ }
325
333
  const isCalendarLike = (v) => typeof v === "object" &&
326
334
  v !== null &&
327
335
  typeof v.dayInfoOn === "function" &&
@@ -339,9 +347,7 @@ export function combineCalendars(calendars, options) {
339
347
  throw rangeError("invalid-argument", `calendars[${i}] is the same calendar as calendars[${calendars.indexOf(c)}]`);
340
348
  }
341
349
  });
342
- const o = isPlainObject(options)
343
- ? withoutUndefined(renameKeys("throw", ["combine"], "", options))
344
- : {};
350
+ const o = optionsObject(options, "combineCalendars options", (v) => renameKeys("throw", ["combine"], "", v), true, "invalid-option");
345
351
  const mode = o["open"];
346
352
  if (mode !== "all" && mode !== "any") {
347
353
  throw rangeError("invalid-option", 'open must be "all" or "any"');
@@ -399,16 +405,14 @@ export function combineCalendars(calendars, options) {
399
405
  return buildCalendar(lookup, isOpen, info, searchDayLimit);
400
406
  }
401
407
  export function createCalendarFromSchedule(schedule, isOpen, options) {
402
- const info = infoOfSchedule(schedule);
408
+ const info = typeof schedule === "object" && schedule !== null ? infoOfSchedule(schedule) : undefined;
403
409
  if (info === undefined) {
404
410
  throw rangeError("invalid-argument", "schedule must be a schedule created by createSchedule");
405
411
  }
406
412
  if (typeof isOpen !== "function") {
407
413
  throw rangeError("invalid-argument", "isOpen must be a function (value) => boolean");
408
414
  }
409
- const o = isPlainObject(options)
410
- ? withoutUndefined(renameKeys("throw", ["fromSchedule"], "", options))
411
- : {};
415
+ const o = optionsObject(options, "createCalendarFromSchedule options", (v) => renameKeys("throw", ["fromSchedule"], "", v));
412
416
  const searchDayLimit = (o["searchDayLimit"] ?? 3660);
413
417
  if (!Number.isInteger(searchDayLimit) || searchDayLimit < 1) {
414
418
  throw rangeError("invalid-option", "searchDayLimit must be a positive integer");
package/dist/core/date.js CHANGED
@@ -1,17 +1,17 @@
1
- import { rangeError } from "./errors.js";
1
+ import { describeValue, rangeError } from "./errors.js";
2
2
  const DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
3
3
  const MS_PER_DAY = 86_400_000;
4
4
  const MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
5
5
  export function parseDate(value) {
6
- const m = DATE_RE.exec(value);
6
+ const m = typeof value === "string" ? DATE_RE.exec(value) : null;
7
7
  if (!m) {
8
- throw rangeError("invalid-date", `Invalid date string: ${JSON.stringify(value)} (expected YYYY-MM-DD)`);
8
+ throw rangeError("invalid-date", `Invalid date string: ${describeValue(value)} (expected YYYY-MM-DD)`);
9
9
  }
10
10
  const year = Number(m[1]);
11
11
  const month = Number(m[2]);
12
12
  const day = Number(m[3]);
13
13
  if (year < 1000 || month < 1 || month > 12 || day < 1 || day > lengthOfMonth(year, month)) {
14
- throw rangeError("invalid-date", `Invalid date: ${value}`);
14
+ throw rangeError("invalid-date", `Invalid date: ${describeValue(value)}`);
15
15
  }
16
16
  return { year, month, day };
17
17
  }
@@ -42,7 +42,7 @@ export function lengthOfMonth(year, month) {
42
42
  return isLeapYear(year) ? 29 : 28;
43
43
  const days = MONTH_DAYS[month - 1];
44
44
  if (days === undefined)
45
- throw rangeError("invalid-date", `Invalid month: ${month}`);
45
+ throw rangeError("invalid-date", `Invalid month: ${describeValue(month)}`);
46
46
  return days;
47
47
  }
48
48
  export function toDayNumber(date) {
@@ -55,7 +55,7 @@ export function fromDayNumber(dayNumber) {
55
55
  }
56
56
  export function addDays(date, n) {
57
57
  if (!Number.isInteger(n)) {
58
- throw rangeError("invalid-argument", `n must be an integer: ${n}`);
58
+ throw rangeError("invalid-argument", `n must be an integer: ${describeValue(n)}`);
59
59
  }
60
60
  return fromDayNumber(toDayNumber(date) + n);
61
61
  }
@@ -1,8 +1,8 @@
1
- import { lengthOfMonth, fromDayNumber, isValidDate, parseDate, toDayNumber, weekdayOf, } from "./date.js";
1
+ import { formatDate, lengthOfMonth, fromDayNumber, isValidDate, parseDate, toDayNumber, weekdayOf, } from "./date.js";
2
2
  import { compileCalendarOptions } from "./calendar.js";
3
- import { internalError, InternalError, IssueCollector, rangeError, } from "./errors.js";
3
+ import { internalError, InternalError, describeValue, IssueCollector, rangeError, } from "./errors.js";
4
4
  import { RENAMED_KEYS, RENAMED_VALUES } from "./renamed.js";
5
- import { compileScheduleOptions, createBasis, createHolidayLookup, createResolver, inPeriod, jpUsage, matchMonthDay, matchPattern, isHolidayBasedRule, resultIgnoresHolidays, } from "./schedule.js";
5
+ import { compileScheduleOptions, createBasis, createHolidayLookup, createResolver, inPeriod, MAX_HOLIDAY_RUN, jpUsage, matchMonthDay, matchPattern, isHolidayBasedRule, resultIgnoresHolidays, } from "./schedule.js";
6
6
  function editDistance(a, b) {
7
7
  const d = Array.from({ length: a.length + 1 }, (_, i) => Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)));
8
8
  for (let i = 1; i <= a.length; i++) {
@@ -840,24 +840,39 @@ function compileDiagnoseOptions(options) {
840
840
  if (asOf === undefined)
841
841
  return { asOf: null };
842
842
  if (!isValidDate(asOf)) {
843
- throw rangeError("invalid-date", `asOf must be a date string "YYYY-MM-DD": ${JSON.stringify(asOf)}`);
843
+ throw rangeError("invalid-date", `asOf must be a date string "YYYY-MM-DD": ${describeValue(asOf)}`);
844
844
  }
845
845
  return { asOf: toDayNumber(asOf) };
846
846
  }
847
847
  function checkExpired(c, compiled, asOf) {
848
- const ended = (path, last, what) => {
849
- if (last < asOf) {
850
- c.info("expired", path, `This ${what} ended on ${fromDayNumber(last)}, before ${fromDayNumber(asOf)}; it no longer affects results and can be removed if the past need not be reproduced`);
848
+ const ended = (path, last, what, reach = last, why = "") => {
849
+ if (reach < asOf) {
850
+ const until = reach > last ? ` (it could affect results until ${fromDayNumber(reach)}: ${why})` : "";
851
+ c.info("expired", path, `This ${what} ended on ${fromDayNumber(last)}${until}, before ${fromDayNumber(asOf)}; it no longer affects results and can be removed if the past need not be reproduced`);
851
852
  }
852
853
  };
854
+ const counting = compiled.recurring.filter((r) => r.businessDays !== null && r.basis === null);
855
+ const byMonth = counting.some((r) => r.weekStart === null);
856
+ const byWeek = counting.some((r) => r.weekStart !== null);
857
+ const countedReach = (last) => {
858
+ let reach = last;
859
+ if (byMonth) {
860
+ const { year, month } = parseDate(fromDayNumber(last));
861
+ reach = toDayNumber(formatDate(year, month, lengthOfMonth(year, month)));
862
+ }
863
+ return byWeek ? Math.max(reach, last + 6) : reach;
864
+ };
865
+ const COUNTED = "a rule counting the business days of a month or week counts it";
853
866
  for (const r of compiled.dates)
854
- ended(r.path, r.to, "date");
867
+ ended(r.path, r.to, "date", countedReach(r.to), COUNTED);
855
868
  for (const r of compiled.annual)
856
869
  if (r.effectiveTo !== null)
857
- ended(r.path, r.effectiveTo, "rule");
870
+ ended(r.path, r.effectiveTo, "rule", countedReach(r.effectiveTo), COUNTED);
858
871
  for (const r of compiled.recurring)
859
872
  if (r.effectiveTo !== null)
860
- ended(r.path, r.effectiveTo, "rule");
873
+ ended(r.path, r.effectiveTo, "rule", r.holidayOverlapPolicy === "after-holiday"
874
+ ? r.effectiveTo + MAX_HOLIDAY_RUN
875
+ : r.effectiveTo, `a day moved by "after-holiday" falls at most ${MAX_HOLIDAY_RUN} days after it`);
861
876
  }
862
877
  function checkUnconfirmedOption(c, compiled) {
863
878
  if (compiled.source.unconfirmedHolidayPolicy !== "throw")
@@ -34,7 +34,7 @@ export type KnownErrorCode =
34
34
  | "invalid-option"
35
35
  /** 祝日の提供元どうしのタイムゾーンが異なり、timeZone の指定が必要 */
36
36
  | "time-zone-conflict"
37
- /** 対応している年の範囲の外 */
37
+ /** 対応している年の範囲の外(提供元の対応年、または日付として扱える 1000〜9999 年の外) */
38
38
  | "out-of-range"
39
39
  /** 判定が未確定の祝日(confirmed: false)に触れた(unconfirmedHolidayPolicy: "throw") */
40
40
  | "unconfirmed-holiday"
@@ -69,6 +69,12 @@ export declare class InternalError extends Error {
69
69
  }
70
70
  /** @internal 作りの誤りの例外を作る(到達しない箇所の例外は、すべてこの形にする) */
71
71
  export declare function internalError(message: string): InternalError;
72
+ /**
73
+ * @internal 例外のメッセージに値を埋め込むときの表し方。Symbol・BigInt でもメッセージを組み立てられる(テンプレート文字列と
74
+ * JSON.stringify は、これらで TypeError を投げるか undefined を返す)。数は String の形(NaN・Infinity を JSON の null にしない)、
75
+ * 文字列は引用符付き(空文字列や空白を見分けられる)、Date・Map などは種類("[object Date]")、ほかの値は JSON の形
76
+ */
77
+ export declare function describeValue(value: unknown): string;
72
78
  /** @internal */
73
79
  export declare function typeError(code: KnownErrorCode, message: string): TypeError;
74
80
  /** @internal 問題の重さ */
@@ -17,6 +17,23 @@ export class InternalError extends Error {
17
17
  export function internalError(message) {
18
18
  return new InternalError(`bizdays-toolkit internal error: ${message}`);
19
19
  }
20
+ export function describeValue(value) {
21
+ if (typeof value === "number" || typeof value === "symbol")
22
+ return String(value);
23
+ if (typeof value === "bigint")
24
+ return `${value}n`;
25
+ if (typeof value === "function")
26
+ return "a function";
27
+ const tag = Object.prototype.toString.call(value);
28
+ if (value && typeof value === "object" && !/^\[object (Object|Array)\]$/.test(tag))
29
+ return tag;
30
+ try {
31
+ return JSON.stringify(value) ?? String(value);
32
+ }
33
+ catch {
34
+ return tag;
35
+ }
36
+ }
20
37
  export function typeError(code, message) {
21
38
  return withCode(new TypeError(message), code);
22
39
  }
@@ -70,6 +70,11 @@ export interface CivilDateTime {
70
70
  export declare function validateTimeZone(timeZone: string): string;
71
71
  /** @internal 瞬間(エポックミリ秒)を、タイムゾーンでの暦日と時刻に変換する */
72
72
  export declare function instantToCivil(epochMilliseconds: number, timeZone: string): CivilDateTime;
73
+ /**
74
+ * Date か(iframe や vm など、別の実行環境で作られた Date も含む)。
75
+ * instanceof は実行環境ごとに Date が別物になるため使わない
76
+ */
77
+ export declare function isDate(value: unknown): value is Date;
73
78
  /** @internal 入力をタイムゾーンでの暦日と時刻に変換する */
74
79
  export declare function toCivil(input: DateInput, timeZone: string): CivilDateTime;
75
80
  /**
@@ -1,6 +1,6 @@
1
1
  import { formatDate, parseDate } from "./date.js";
2
- import { rangeError, typeError } from "./errors.js";
3
- const DATETIME_RE = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,9})?)?(Z|[+-]\d{2}:?\d{2})?$/i;
2
+ import { describeValue, rangeError, typeError } from "./errors.js";
3
+ const DATETIME_RE = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,9}))?)?(Z|[+-]\d{2}:?\d{2})?$/i;
4
4
  const formatters = new Map();
5
5
  function formatterFor(timeZone) {
6
6
  let f = formatters.get(timeZone);
@@ -20,13 +20,13 @@ function formatterFor(timeZone) {
20
20
  }
21
21
  export function validateTimeZone(timeZone) {
22
22
  if (typeof timeZone !== "string" || timeZone === "") {
23
- throw rangeError("invalid-time-zone", `Invalid time zone: ${JSON.stringify(timeZone)}`);
23
+ throw rangeError("invalid-time-zone", `Invalid time zone: ${describeValue(timeZone)}`);
24
24
  }
25
25
  try {
26
26
  return formatterFor(timeZone).resolvedOptions().timeZone;
27
27
  }
28
28
  catch {
29
- throw rangeError("invalid-time-zone", `Invalid time zone: ${JSON.stringify(timeZone)}`);
29
+ throw rangeError("invalid-time-zone", `Invalid time zone: ${describeValue(timeZone)}`);
30
30
  }
31
31
  }
32
32
  export function instantToCivil(epochMilliseconds, timeZone) {
@@ -51,7 +51,8 @@ function wallTime(hour, minute) {
51
51
  !Number.isInteger(minute) ||
52
52
  minute < 0 ||
53
53
  minute > 59) {
54
- throw rangeError("invalid-time", `Invalid time: ${hour}:${minute}`);
54
+ const two = (v) => String(v).padStart(2, "0");
55
+ throw rangeError("invalid-time", `Invalid time: ${two(hour)}:${two(minute)}`);
55
56
  }
56
57
  return hour * 60 + minute;
57
58
  }
@@ -62,22 +63,22 @@ function parseString(value, timeZone) {
62
63
  }
63
64
  const m = DATETIME_RE.exec(value);
64
65
  if (!m) {
65
- throw rangeError(/^\d{4}-\d{2}-\d{2}[T ]/i.test(value) ? "invalid-time" : "invalid-date", `Invalid date/time string: ${JSON.stringify(value)} (expected YYYY-MM-DD or ISO 8601 date-time)`);
66
+ throw rangeError(/^\d{4}-\d{2}-\d{2}[T ]/i.test(value) ? "invalid-time" : "invalid-date", `Invalid date/time string: ${describeValue(value)} (expected YYYY-MM-DD or ISO 8601 date-time)`);
66
67
  }
67
68
  const date = m[1];
68
- parseDate(date);
69
+ const { year, month, day } = parseDate(date);
69
70
  const minutes = wallTime(Number(m[2]), Number(m[3]));
70
71
  if (m[4] !== undefined && Number(m[4]) > 59) {
71
- throw rangeError("invalid-time", `Invalid time: ${value}`);
72
+ throw rangeError("invalid-time", `Invalid date/time string: ${describeValue(value)}`);
72
73
  }
73
- const offset = m[5];
74
+ const offset = m[6];
74
75
  if (offset === undefined)
75
76
  return { date, minutes };
76
- const normalized = value.replace(/([+-]\d{2})(\d{2})$/, "$1:$2");
77
- const ms = Date.parse(normalized);
78
- if (Number.isNaN(ms)) {
79
- throw rangeError("invalid-time", `Invalid date/time string: ${JSON.stringify(value)}`);
80
- }
77
+ const [, hh = "0", mm = "0"] = /(\d\d):?(\d\d)$/.exec(offset) ?? [];
78
+ if (+hh > 23 || +mm > 59)
79
+ throw rangeError("invalid-time", `Invalid date/time string: ${describeValue(value)}`);
80
+ const ms = Date.UTC(year, month - 1, day, 0, minutes, +(m[4] ?? 0), +(m[5] ?? "0").padEnd(3, "0").slice(0, 3)) -
81
+ (offset[0] === "-" ? -1 : 1) * (+hh * 60 + +mm) * 60_000;
81
82
  return instantToCivil(ms, timeZone);
82
83
  }
83
84
  function isInstantLike(value) {
@@ -87,7 +88,7 @@ function isDateLike(value) {
87
88
  const v = value;
88
89
  return typeof v.year === "number" && typeof v.month === "number" && typeof v.day === "number";
89
90
  }
90
- function isDate(value) {
91
+ export function isDate(value) {
91
92
  return Object.prototype.toString.call(value) === "[object Date]";
92
93
  }
93
94
  export function toCivil(input, timeZone) {
@@ -144,7 +145,7 @@ export function parseTimeOfDaySeconds(value) {
144
145
  const m = typeof value === "string" ? /^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(value) : null;
145
146
  const seconds = m ? Number(m[3] ?? "0") : NaN;
146
147
  if (!m || seconds > 59) {
147
- throw rangeError("invalid-time", `Invalid time of day: ${JSON.stringify(value)} (expected HH:mm or HH:mm:ss)`);
148
+ throw rangeError("invalid-time", `Invalid time of day: ${describeValue(value)} (expected HH:mm or HH:mm:ss)`);
148
149
  }
149
150
  return wallTime(Number(m[1]), Number(m[2])) * 60 + seconds;
150
151
  }
@@ -1,12 +1,12 @@
1
1
  import { addDays, lengthOfMonth, formatDate, parseDate } from "./date.js";
2
- import { rangeError } from "./errors.js";
2
+ import { describeValue, rangeError } from "./errors.js";
3
3
  const MONTH_RE = /^(\d{4})-(\d{2})$/;
4
4
  export function parseMonth(value) {
5
5
  const m = typeof value === "string" ? MONTH_RE.exec(value) : null;
6
6
  const year = Number(m?.[1]);
7
7
  const month = Number(m?.[2]);
8
8
  if (!m || year < 1000 || month < 1 || month > 12) {
9
- throw rangeError("invalid-month", `Invalid month: ${JSON.stringify(value)} (expected YYYY-MM)`);
9
+ throw rangeError("invalid-month", `Invalid month: ${describeValue(value)} (expected YYYY-MM)`);
10
10
  }
11
11
  return { year, month };
12
12
  }
@@ -27,7 +27,7 @@ export function dayOfMonth({ year, month }, day) {
27
27
  export const isDayOfMonthValue = (v) => v === -1 || (Number.isInteger(v) && v >= 1 && v <= 31);
28
28
  export function monthOf(input, offset = 0) {
29
29
  if (!Number.isInteger(offset)) {
30
- throw rangeError("invalid-argument", `offset must be an integer: ${offset}`);
30
+ throw rangeError("invalid-argument", `offset must be an integer: ${describeValue(offset)}`);
31
31
  }
32
32
  const base = typeof input === "string" && input.split("-").length === 3
33
33
  ? parseDate(input)
@@ -41,7 +41,7 @@ export function closingMonth(date, closingDayOfMonth) {
41
41
  }
42
42
  export function checkClosingDay(closingDayOfMonth) {
43
43
  if (!isDayOfMonthValue(closingDayOfMonth)) {
44
- throw rangeError("invalid-argument", `closingDayOfMonth must be an integer from 1 to 31, or -1 (last day): ${closingDayOfMonth}`);
44
+ throw rangeError("invalid-argument", `closingDayOfMonth must be an integer from 1 to 31, or -1 (last day): ${describeValue(closingDayOfMonth)}`);
45
45
  }
46
46
  }
47
47
  export function closingDayIn({ year, month }, closingDayOfMonth) {
@@ -739,6 +739,11 @@ export declare const PERIOD_KEYS: string[];
739
739
  export declare const RECURRING_RULE_KEYS: string[];
740
740
  /** @internal スケジュールの設定を検証して取り込む(誤りは c に集める) */
741
741
  export declare function compileScheduleOptions<Value, Kind extends string>(c: IssueCollector, options: unknown): CompiledSchedule<Value, Kind> | undefined;
742
+ /**
743
+ * @internal 振替元をさかのぼる日数と、祝日の翌日・祝前日の塊を調べる日数の上限(祝日と飛ばす曜日が続く日数。2019 年の大型連休でも 10 日)。
744
+ * 診断の expired も、"after-holiday" の規則の振替が届きうる最も遠い日として使う
745
+ */
746
+ export declare const MAX_HOLIDAY_RUN = 31;
742
747
  /** @internal 毎年の月日の規則の形がその月日 "MM-DD" に当てはまるか(有効期間は考えない) */
743
748
  export declare function matchMonthDay(rule: AnnualRule<unknown>, monthDay: string): boolean;
744
749
  /** @internal 毎年の月日の規則がその日に当てはまるか(有効期間を含む) */
@@ -1,7 +1,7 @@
1
1
  import { addDays, lengthOfMonth, formatDate, fromDayNumber, isValidDate, parseDate, toDayNumber, weekdayOf, } from "./date.js";
2
- import { checkUnknownKeys, IssueCollector, rangeError, withoutUndefined, } from "./errors.js";
2
+ import { checkUnknownKeys, describeValue, IssueCollector, rangeError, withoutUndefined, } from "./errors.js";
3
3
  import { RENAMED_VALUES, renameKeys, renameValue, writtenKey } from "./renamed.js";
4
- import { instantToCivil, toCivil, toDateTimeParts, toInstant, validateTimeZone, } from "./input.js";
4
+ import { instantToCivil, isDate, toCivil, toDateTimeParts, toInstant, validateTimeZone, } from "./input.js";
5
5
  import { HOLIDAY_KEY_PATTERN } from "./types.js";
6
6
  const MONTH_DAY_RE = /^(\d{2})-(\d{2})$/;
7
7
  const MAX_DAYS_IN_MONTH = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
@@ -51,14 +51,14 @@ function checkName(c, path, name) {
51
51
  }
52
52
  function checkDate(c, path, value) {
53
53
  if (!isValidDate(value)) {
54
- c.error("invalid-date", path, `Invalid date ${JSON.stringify(value)} (expected YYYY-MM-DD)`);
54
+ c.error("invalid-date", path, `Invalid date ${describeValue(value)} (expected YYYY-MM-DD)`);
55
55
  return undefined;
56
56
  }
57
57
  return toDayNumber(value);
58
58
  }
59
59
  function checkMonthDay(c, path, value) {
60
60
  if (!isValidMonthDay(value)) {
61
- c.error("invalid-annual-date", path, `Invalid annual date ${JSON.stringify(value)} (expected MM-DD)`);
61
+ c.error("invalid-annual-date", path, `Invalid annual date ${describeValue(value)} (expected MM-DD)`);
62
62
  return undefined;
63
63
  }
64
64
  return value;
@@ -658,7 +658,7 @@ function validateProvider(c, path, p) {
658
658
  validateTimeZone(p["timeZone"]);
659
659
  }
660
660
  catch {
661
- return bad(`"timeZone" is not a valid IANA time zone: ${JSON.stringify(p["timeZone"])}`);
661
+ return bad(`"timeZone" is not a valid IANA time zone: ${describeValue(p["timeZone"])}`);
662
662
  }
663
663
  const years = p["supportedYears"];
664
664
  if (!isObject(years) ||
@@ -716,7 +716,7 @@ export function compileHolidaySource(c, options) {
716
716
  timeZone = validateTimeZone(options["timeZone"]);
717
717
  }
718
718
  catch {
719
- c.error("invalid-time-zone", "timeZone", `Invalid time zone: ${JSON.stringify(options["timeZone"])}`);
719
+ c.error("invalid-time-zone", "timeZone", `Invalid time zone: ${describeValue(options["timeZone"])}`);
720
720
  }
721
721
  }
722
722
  else {
@@ -754,7 +754,7 @@ function loadProviderYear(provider, year) {
754
754
  throw providerDataError(provider, year, `item ${i} is not an object`);
755
755
  const { date, name, nameEn, kind, confirmed } = h;
756
756
  if (!isValidDate(date) || parseDate(date).year !== year) {
757
- throw providerDataError(provider, year, `item ${i} has an invalid date ${JSON.stringify(date)}`);
757
+ throw providerDataError(provider, year, `item ${i} has an invalid date ${describeValue(date)}`);
758
758
  }
759
759
  if (seen.has(date))
760
760
  throw providerDataError(provider, year, `duplicate date ${date}`);
@@ -780,7 +780,7 @@ function loadProviderYear(provider, year) {
780
780
  }
781
781
  if (h["key"] !== undefined) {
782
782
  if (typeof h["key"] !== "string" || !HOLIDAY_KEY_PATTERN.test(h["key"])) {
783
- throw providerDataError(provider, year, `item ${i} (${date}) key must match ${String(HOLIDAY_KEY_PATTERN)}: ${JSON.stringify(h["key"])}`);
783
+ throw providerDataError(provider, year, `item ${i} (${date}) key must match ${String(HOLIDAY_KEY_PATTERN)}: ${describeValue(h["key"])}`);
784
784
  }
785
785
  holiday.key = h["key"];
786
786
  }
@@ -798,13 +798,13 @@ function checkNames(names) {
798
798
  canonical = Intl.getCanonicalLocales(tag)[0];
799
799
  }
800
800
  catch {
801
- return `${JSON.stringify(tag)} is not a BCP 47 language tag`;
801
+ return `${describeValue(tag)} is not a BCP 47 language tag`;
802
802
  }
803
803
  if (canonical !== tag) {
804
- return `${JSON.stringify(tag)} must be written in canonical form ${JSON.stringify(canonical)}`;
804
+ return `${describeValue(tag)} must be written in canonical form ${describeValue(canonical)}`;
805
805
  }
806
806
  if (typeof value !== "string" || value === "") {
807
- return `${JSON.stringify(tag)} must be a non-empty string`;
807
+ return `${describeValue(tag)} must be a non-empty string`;
808
808
  }
809
809
  }
810
810
  return undefined;
@@ -860,7 +860,7 @@ export function createHolidayLookup(source) {
860
860
  const dateOf = (input) => toCivil(input, timeZone).date;
861
861
  function holidaysInYear(year) {
862
862
  if (!Number.isInteger(year))
863
- throw rangeError("invalid-argument", `Invalid year: ${year}`);
863
+ throw rangeError("invalid-argument", `Invalid year: ${describeValue(year)}`);
864
864
  return Object.freeze([...holidayMap(year).values()].sort((a, b) => a.date < b.date ? -1 : a.date > b.date ? 1 : 0));
865
865
  }
866
866
  return {
@@ -875,7 +875,12 @@ export function createHolidayLookup(source) {
875
875
  dateOf,
876
876
  civilOf: ((input) => toDateTimeParts(input, timeZone)),
877
877
  instantOf: (date, time) => toInstant(date, time, timeZone),
878
- today: (now = new Date()) => instantToCivil(now.getTime(), timeZone).date,
878
+ today: (now = new Date()) => {
879
+ if (!isDate(now)) {
880
+ throw rangeError("invalid-argument", `today expects a Date: ${describeValue(now)}`);
881
+ }
882
+ return instantToCivil(Date.prototype.getTime.call(now), timeZone).date;
883
+ },
879
884
  isHoliday: (input) => holidayOfDate(dateOf(input)) !== undefined,
880
885
  holidayOn: (input) => holidayOfDate(dateOf(input)),
881
886
  getHoliday: (input) => holidayOfDate(dateOf(input)),
@@ -981,7 +986,7 @@ export function compileScheduleOptions(c, options) {
981
986
  }
982
987
  return { source, weekly, holiday, annual, dates, recurring };
983
988
  }
984
- const MAX_HOLIDAY_RUN = 31;
989
+ export const MAX_HOLIDAY_RUN = 31;
985
990
  export function matchMonthDay(rule, monthDay) {
986
991
  return rule.from <= rule.to
987
992
  ? monthDay >= rule.from && monthDay <= rule.to
package/dist/fr/rules.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addDays, easterSunday, formatDate } from "../core/date.js";
2
- import { rangeError } from "../core/errors.js";
2
+ import { describeValue, rangeError } from "../core/errors.js";
3
3
  export const SUPPORTED_YEARS = Object.freeze({ from: 2000, to: 2099 });
4
4
  export const DATA_VERSION = "2026-10";
5
5
  const FIXED = [
@@ -20,7 +20,9 @@ const EASTER_BASED = [
20
20
  ];
21
21
  const EASTER_BASED_ALSACE_MOSELLE = [[-2, "Vendredi saint", "Good Friday", "good-friday"]];
22
22
  export function computeFrHolidays(zone, year) {
23
- if (!Number.isInteger(year) || year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
23
+ if (!Number.isInteger(year))
24
+ throw rangeError("out-of-range", `Invalid year: ${describeValue(year)} (expected an integer)`);
25
+ if (year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
24
26
  throw rangeError("out-of-range", `French public holidays are supported for ${SUPPORTED_YEARS.from}-${SUPPORTED_YEARS.to}; requested ${year}`);
25
27
  }
26
28
  const alsaceMoselle = zone === "alsace-moselle";
package/dist/jp/rules.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addDays, formatDate, nthWeekdayOfMonth, weekdayOf, } from "../core/date.js";
2
- import { rangeError } from "../core/errors.js";
2
+ import { describeValue, rangeError } from "../core/errors.js";
3
3
  export const SUPPORTED_YEARS = Object.freeze({ from: 1955, to: 2099 });
4
4
  export const CONFIRMED_THROUGH = 2027;
5
5
  export const DATA_VERSION = "2026-02";
@@ -98,7 +98,9 @@ function baseHolidays(y) {
98
98
  return list.sort((a, b) => (a.date < b.date ? -1 : 1));
99
99
  }
100
100
  export function computeJapaneseHolidays(year) {
101
- if (!Number.isInteger(year) || year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
101
+ if (!Number.isInteger(year))
102
+ throw rangeError("out-of-range", `Invalid year: ${describeValue(year)} (expected an integer)`);
103
+ if (year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
102
104
  throw rangeError("out-of-range", `Japanese holidays are supported for ${SUPPORTED_YEARS.from}-${SUPPORTED_YEARS.to}; requested ${year}`);
103
105
  }
104
106
  const base = baseHolidays(year);
@@ -1,6 +1,6 @@
1
1
  import { addDays, lengthOfMonth as daysInMonthOf, easterSunday as easterSundayOf, formatDate, isLeapYear as isLeapYearOf, isValidDate, nthWeekdayOfMonth as nthWeekdayOfMonthIn, parseDate, weekdayOf, } from "../core/date.js";
2
2
  import { renameKeys } from "../core/renamed.js";
3
- import { rangeError } from "../core/errors.js";
3
+ import { describeValue, rangeError } from "../core/errors.js";
4
4
  import { HOLIDAY_KEY_PATTERN } from "../core/types.js";
5
5
  function checkYear(year) {
6
6
  if (!Number.isInteger(year) || year < 1000 || year > 9999) {
@@ -58,7 +58,7 @@ function checkHolidays(holidays) {
58
58
  }
59
59
  const { date, name, nameEn, kind, confirmed, key } = h;
60
60
  if (!isValidDate(date)) {
61
- throw rangeError("invalid-date", `holidays[${i}] has an invalid date ${JSON.stringify(date)}`);
61
+ throw rangeError("invalid-date", `holidays[${i}] has an invalid date ${describeValue(date)}`);
62
62
  }
63
63
  const y = parseDate(date).year;
64
64
  if (year === undefined)
@@ -76,7 +76,7 @@ function checkHolidays(holidays) {
76
76
  throw rangeError("invalid-argument", `holidays[${i}] (${date}) must have boolean confirmed`);
77
77
  }
78
78
  if (key !== undefined && (typeof key !== "string" || !HOLIDAY_KEY_PATTERN.test(key))) {
79
- throw rangeError("invalid-argument", `holidays[${i}] (${date}) key must match ${String(HOLIDAY_KEY_PATTERN)}: ${JSON.stringify(key)}`);
79
+ throw rangeError("invalid-argument", `holidays[${i}] (${date}) key must match ${String(HOLIDAY_KEY_PATTERN)}: ${describeValue(key)}`);
80
80
  }
81
81
  });
82
82
  return holidays;
@@ -92,10 +92,10 @@ function checkOptions(options) {
92
92
  }
93
93
  for (const [weekday, direction] of Object.entries(rules)) {
94
94
  if (!/^[0-6]$/.test(weekday)) {
95
- throw rangeError("invalid-weekday", `options.directions has a weekday that is not 0 (Sunday) to 6 (Saturday): ${JSON.stringify(weekday)}`);
95
+ throw rangeError("invalid-weekday", `options.directions has a weekday that is not 0 (Sunday) to 6 (Saturday): ${describeValue(weekday)}`);
96
96
  }
97
97
  if (direction !== "next" && direction !== "previous") {
98
- throw rangeError("invalid-argument", `options.directions[${weekday}] must be "next" or "previous": ${JSON.stringify(direction)}`);
98
+ throw rangeError("invalid-argument", `options.directions[${weekday}] must be "next" or "previous": ${describeValue(direction)}`);
99
99
  }
100
100
  }
101
101
  if (typeof kind !== "string" || kind === "") {
package/dist/sg/rules.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addDays, formatDate, weekdayOf } from "../core/date.js";
2
- import { rangeError } from "../core/errors.js";
2
+ import { describeValue, rangeError } from "../core/errors.js";
3
3
  export const SUPPORTED_YEARS = Object.freeze({ from: 2020, to: 2027 });
4
4
  export const CONFIRMED_THROUGH = 2027;
5
5
  export const DATA_VERSION = "2026-07";
@@ -112,6 +112,8 @@ const FIXED = [
112
112
  [12, 25, CHRISTMAS],
113
113
  ];
114
114
  export function computeSgHolidays(year) {
115
+ if (!Number.isInteger(year))
116
+ throw rangeError("out-of-range", `Invalid year: ${describeValue(year)} (expected an integer)`);
115
117
  const movable = MOVABLE[year];
116
118
  if (movable === undefined) {
117
119
  throw rangeError("out-of-range", `Singapore public holidays are available for ${SUPPORTED_YEARS.from}-${SUPPORTED_YEARS.to}: ${year}`);
package/dist/uk/rules.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { addDays, lengthOfMonth, easterSunday, formatDate, nthWeekdayOfMonth, weekdayOf, } from "../core/date.js";
2
- import { rangeError } from "../core/errors.js";
2
+ import { describeValue, rangeError } from "../core/errors.js";
3
3
  export const SUPPORTED_YEARS = Object.freeze({ from: 1974, to: 2099 });
4
4
  export const CONFIRMED_THROUGH = 2028;
5
5
  export const DATA_VERSION = "2026-02";
@@ -169,7 +169,9 @@ function isWeekend(date) {
169
169
  return w === 0 || w === 6;
170
170
  }
171
171
  export function computeUkHolidays(division, year) {
172
- if (!Number.isInteger(year) || year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
172
+ if (!Number.isInteger(year))
173
+ throw rangeError("out-of-range", `Invalid year: ${describeValue(year)} (expected an integer)`);
174
+ if (year < SUPPORTED_YEARS.from || year > SUPPORTED_YEARS.to) {
173
175
  throw rangeError("out-of-range", `UK bank holidays are supported for ${SUPPORTED_YEARS.from}-${SUPPORTED_YEARS.to}; requested ${year}`);
174
176
  }
175
177
  const scotland = division === "scotland";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
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",