bizdays-toolkit 0.32.4 → 0.32.6

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,18 @@ Entries from 0.31.0 are in English. Earlier entries remain in Japanese (their **
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.32.6] - 2026-11-20
10
+
11
+ ### Fixed
12
+
13
+ - The option diagnostics could report as `redundant` a rule or date whose removal changed the results, breaking the promise that the reported rules can be removed all together. This happened for an item that takes effect only outside the effective period of another rule (after its `effectiveTo` or before its `effectiveFrom`), for an item that takes effect only outside the supported years of a holiday provider used with `outOfRangePolicy: "ignore"`, and, in a schedule without a holiday provider (or with `"ignore"`), for an item whose days depend on how the counting calendar (`calendar`) of an nth-business-day rule changes outside the years checked: effective periods, specific dates, `interval` or `cycle` rules and holiday providers inside that calendar, including combined calendars and calendars made from schedules (a schedule counted on a calendar with Japan's holidays is one such setup), and days on which the counting calendar throws outside its supported years. The diagnostics now also check one cycle of the rules on each side of each such boundary, so the years in the messages can be wider (for example `checked 1963-2028`). When they cannot read the counting calendar (an object shaped like a calendar but not made by `createCalendar`, `combineCalendars` or `createCalendarFromSchedule`) or the range would be too long, they no longer report the annual dates and recurring rules of those options as `redundant`, or the rules counted on that calendar as `never-matches`. For the same reason, `no-business-day` is no longer reported for options that have business days after an effective period ends. A date range in `closedDates`, `openDates` or a schedule's `dates` that is longer than 200 years is no longer reported as `redundant`, because the diagnostics do not check all of its days, and options in which such a range closes every remaining day (for example up to 9999-12-31) no longer get `no-business-day`. The results of calendars and schedules do not change. Most options get fewer items; in some, another rule is now reported as `redundant` in place of the incorrect item (it can be removed together with the other reported rules). If you removed rules because an earlier version reported them as `redundant`, check that the results you rely on have not changed
14
+
15
+ ## [0.32.5] - 2026-11-18
16
+
17
+ ### Changed
18
+
19
+ - Calculations that step through days are faster: turning a day number back into a date no longer parses the date string it has just built (the year is still checked against 1000–9999), and the option diagnostics work out the days a recurring rule matches only when two rules are compared. Searching, adding and counting business days, ranges of days and the option diagnostics are faster. Results, exceptions and diagnostics are unchanged
20
+
9
21
  ## [0.32.4] - 2026-11-18
10
22
 
11
23
  ### Fixed
@@ -1032,7 +1044,9 @@ This version rebuilds the `redundant` diagnostic so that the reported rules can
1032
1044
 
1033
1045
  - 日本: 2026 年 2 月の官報(2027 年の春分・秋分の日)まで反映(`dataVersion: "2026-02"`、`confirmedThrough: 2027`)
1034
1046
 
1035
- [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.4...HEAD
1047
+ [Unreleased]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.6...HEAD
1048
+ [0.32.6]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.5...v0.32.6
1049
+ [0.32.5]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.4...v0.32.5
1036
1050
  [0.32.4]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.3...v0.32.4
1037
1051
  [0.32.3]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.2...v0.32.3
1038
1052
  [0.32.2]: https://github.com/inohan77/bizdays-toolkit/compare/v0.32.1...v0.32.2
@@ -4,7 +4,7 @@ import { isOptionsObject } from "./options.js";
4
4
  import { renameKeys, writtenKey } from "./renamed.js";
5
5
  import { distinctTimeZones, parseTimeOfDaySeconds, toCivil } from "./input.js";
6
6
  import { checkClosingDay, closingDayIn, closingMonth as calendarClosingMonth, dayOfMonth, formatMonth, isDayOfMonthValue, parseMonth, readsAsDate, shiftMonth, } from "./month.js";
7
- import { buildSchedule, compileAnnualRules, compileDateRules, compileHolidaySource, compileRecurringRules, createHolidayLookup, infoOfSchedule, valuesOfSchedule, isWeekday, mapDays, RECURRING_RULE_KEYS, jpUsage, } from "./schedule.js";
7
+ import { buildSchedule, compileAnnualRules, compileDateRules, compileHolidaySource, compileRecurringRules, createHolidayLookup, infoOfSchedule, PARTS, partsHolder, partsOf, valuesOfSchedule, isWeekday, mapDays, RECURRING_RULE_KEYS, jpUsage, } from "./schedule.js";
8
8
  export const CALENDAR_OPTION_KEYS = [
9
9
  "holidayProvider",
10
10
  "timeZone",
@@ -222,7 +222,9 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
222
222
  }
223
223
  return found;
224
224
  }
225
+ const parts = partsHolder(partsOf(lookup));
225
226
  const calendar = {
227
+ [PARTS]: parts,
226
228
  timeZone: lookup.timeZone,
227
229
  providers: lookup.providers,
228
230
  outOfRangePolicy: lookup.outOfRangePolicy,
@@ -324,6 +326,8 @@ function buildCalendar(lookup, isOpen, info, searchDayLimit) {
324
326
  businessDaysBetween: (from, to) => calendar.diffBusinessDays(from, to),
325
327
  listBusinessDays: (from, to) => calendar.businessDatesBetween(from, to),
326
328
  };
329
+ parts.owner = calendar;
330
+ Object.freeze(parts);
327
331
  return Object.freeze(calendar);
328
332
  }
329
333
  function optionsObject(options, what, rename = (v) => v, required = false, code = "invalid-argument") {
@@ -381,15 +385,17 @@ export function combineCalendars(calendars, options) {
381
385
  });
382
386
  const merge = (lists) => {
383
387
  const byDate = new Map();
384
- for (const list of lists)
385
- for (const h of list)
388
+ for (const holidays of lists)
389
+ for (const h of holidays)
386
390
  if (!byDate.has(h.date))
387
391
  byDate.set(h.date, h);
388
392
  return Object.freeze([...byDate.values()].sort((a, b) => (a.date < b.date ? -1 : a.date > b.date ? 1 : 0)));
389
393
  };
390
394
  const holidayOn = (input) => list.map((c) => c.holidayOn(input)).find((h) => h !== undefined);
395
+ const parts = partsHolder(list);
391
396
  const lookup = {
392
397
  ...base,
398
+ [PARTS]: parts,
393
399
  isHoliday: (input) => holidayOn(input) !== undefined,
394
400
  holidayOn,
395
401
  getHoliday: holidayOn,
@@ -425,6 +431,8 @@ export function combineCalendars(calendars, options) {
425
431
  result.decidedByPath = Object.freeze([decidedBy, ...(decided.decidedByPath ?? [])]);
426
432
  return Object.freeze(result);
427
433
  }
434
+ parts.owner = lookup;
435
+ Object.freeze(parts);
428
436
  return buildCalendar(lookup, isOpen, info, searchDayLimit);
429
437
  }
430
438
  export function createCalendarFromSchedule(schedule, isOpen, options) {
@@ -25,15 +25,21 @@ export declare function parseDate(value: string): {
25
25
  * @public
26
26
  */
27
27
  export declare function isValidDate(input: unknown): input is DateString;
28
- /** 年月日から "YYYY-MM-DD" を作る(範囲外なら RangeError) */
29
- export declare function formatDate(year: number, month: number, day: number): DateString;
28
+ /**
29
+ * 年月日から "YYYY-MM-DD" を作る(範囲外なら RangeError)。exists なら、実在する年月日として解析し直さず、parseDate の
30
+ * 直前 1 件の記憶に入れる(続けて同じ文字列を解析するため。decisions.md の 16 番)
31
+ */
32
+ export declare function formatDate(year: number, month: number, day: number, exists?: boolean): DateString;
30
33
  /** うるう年か */
31
34
  export declare function isLeapYear(year: number): boolean;
32
35
  /** その月の日数 */
33
36
  export declare function lengthOfMonth(year: number, month: number): number;
34
37
  /** 1970-01-01 からの日数 */
35
38
  export declare function toDayNumber(date: DateString): number;
36
- /** 1970-01-01 からの日数を "YYYY-MM-DD" に戻す */
39
+ /**
40
+ * 1970-01-01 からの日数を "YYYY-MM-DD" に戻す。日数から作る年月日は必ず実在するので、文字列を解析し直して検証しない
41
+ * (年の範囲だけを確かめる。探索・期間の数え上げ・診断の走査が 1 日ごとに呼ぶ)
42
+ */
37
43
  export declare function fromDayNumber(dayNumber: number): DateString;
38
44
  /**
39
45
  * n 日後(負なら前)の日付。
package/dist/core/date.js CHANGED
@@ -31,12 +31,15 @@ export function isValidDate(input) {
31
31
  return false;
32
32
  }
33
33
  }
34
- export function formatDate(year, month, day) {
34
+ export function formatDate(year, month, day, exists) {
35
35
  if (!Number.isInteger(year) || year < 1000 || year > 9999) {
36
36
  throw rangeError("out-of-range", `Year out of range (1000-9999): ${year}`);
37
37
  }
38
38
  const s = `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
39
- parseDate(s);
39
+ if (!exists)
40
+ parseDate(s);
41
+ else
42
+ [lastValue, lastParts] = [s, Object.freeze({ year, month, day })];
40
43
  return s;
41
44
  }
42
45
  export function isLeapYear(year) {
@@ -56,7 +59,7 @@ export function toDayNumber(date) {
56
59
  }
57
60
  export function fromDayNumber(dayNumber) {
58
61
  const d = new Date(dayNumber * MS_PER_DAY);
59
- return formatDate(d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate());
62
+ return formatDate(d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(), true);
60
63
  }
61
64
  export function addDays(date, n) {
62
65
  if (!Number.isInteger(n)) {
@@ -3,7 +3,7 @@ import { compileCalendarOptions } from "./calendar.js";
3
3
  import { internalError, InternalError, describeValue, IssueCollector, rangeError, } from "./errors.js";
4
4
  import { isOptionsObject } from "./options.js";
5
5
  import { RENAMED_KEYS, RENAMED_VALUES } from "./renamed.js";
6
- import { compileScheduleOptions, createBasis, createHolidayLookup, createResolver, lostShiftMessage, throwLostShift, inPeriod, MAX_HOLIDAY_RUN, jpUsage, matchMonthDay, matchPattern, isHolidayBasedRule, resultIgnoresHolidays, } from "./schedule.js";
6
+ import { compileScheduleOptions, createBasis, createHolidayLookup, createResolver, lostShiftMessage, throwLostShift, inPeriod, MAX_HOLIDAY_RUN, jpUsage, matchMonthDay, matchPattern, partsOf, isHolidayBasedRule, resultIgnoresHolidays, } from "./schedule.js";
7
7
  function editDistance(a, b) {
8
8
  const d = Array.from({ length: a.length + 1 }, (_, i) => Array.from({ length: b.length + 1 }, (_, j) => (i === 0 ? j : j === 0 ? i : 0)));
9
9
  for (let i = 1; i <= a.length; i++) {
@@ -99,6 +99,7 @@ function patternCycle(rules) {
99
99
  }
100
100
  return Math.min(lcm(PATTERN_DAYS, days), max);
101
101
  }
102
+ const MAX_SCAN_DAYS = 366 * MAX_WINDOW_YEARS * 3;
102
103
  function clipYears(from, to) {
103
104
  if (to - from + 1 <= MAX_WINDOW_YEARS)
104
105
  return [from, to];
@@ -107,8 +108,41 @@ function clipYears(from, to) {
107
108
  return a <= b ? [a, b] : [from, from + MAX_WINDOW_YEARS - 1];
108
109
  }
109
110
  const dayOfYear = (year, last) => toDayNumber(`${String(year).padStart(4, "0")}-${last ? "12-31" : "01-01"}`);
110
- function scanWindow(source, rules, cycle) {
111
+ function collectBasis(calendar, inside) {
112
+ const parts = partsOf(calendar);
113
+ if (parts === undefined)
114
+ return false;
115
+ if (Array.isArray(parts))
116
+ return parts.every((c) => collectBasis(c, inside));
117
+ const { source, annual, recurring, dates } = parts;
118
+ for (const { supportedYears } of source.providers) {
119
+ const [from, to] = clipYears(supportedYears.from, supportedYears.to);
120
+ inside.spans.push({ from: dayOfYear(from, false), to: dayOfYear(to, true) });
121
+ inside.edges.push(dayOfYear(supportedYears.from, false), dayOfYear(supportedYears.to, true) + 1);
122
+ }
123
+ for (const r of [...annual, ...recurring]) {
124
+ if (r.effectiveFrom !== null)
125
+ inside.edges.push(r.effectiveFrom);
126
+ if (r.effectiveTo !== null)
127
+ inside.edges.push(r.effectiveTo + 1);
128
+ }
129
+ for (const r of dates)
130
+ inside.edges.push(r.from, r.to + 1);
131
+ inside.rules.push(...recurring);
132
+ return recurring.every((r) => r.calendar === null || collectBasis(r.calendar, inside));
133
+ }
134
+ const crossesShortCentury = ({ from, to }) => {
135
+ const last = yearOf(Math.min(to, MAX_DAY));
136
+ for (let y = Math.ceil(yearOf(Math.max(from, MIN_DAY)) / 100) * 100; y <= last; y += 100)
137
+ if (y % 400 !== 0)
138
+ return true;
139
+ return false;
140
+ };
141
+ function scanWindow(source, rules, cycle, inside) {
111
142
  const ranges = [];
143
+ const side = (day, before) => before
144
+ ? { from: day - openEndedDays(day - cycle + 1, cycle) + 1, to: day }
145
+ : { from: day, to: day + openEndedDays(day, cycle) - 1 };
112
146
  let extend = true;
113
147
  if (source.providers.length === 0) {
114
148
  ranges.push({ from: PATTERN_FROM, to: PATTERN_FROM + cycle - 1 });
@@ -128,6 +162,8 @@ function scanWindow(source, rules, cycle) {
128
162
  }
129
163
  if (from > to)
130
164
  return undefined;
165
+ if (extend)
166
+ ranges.push(side(dayOfYear(from, false) - 1, true), side(dayOfYear(to, true) + 1, false));
131
167
  [from, to] = clipYears(from, to);
132
168
  ranges.push({ from: dayOfYear(from, false), to: dayOfYear(to, true) });
133
169
  }
@@ -136,10 +172,26 @@ function scanWindow(source, rules, cycle) {
136
172
  if (rule.effectiveFrom === null && rule.effectiveTo === null)
137
173
  continue;
138
174
  const span = periodSpan(rule, cycle);
139
- const to = Math.min(span.to, span.from + 366 * MAX_WINDOW_YEARS - 1);
140
- ranges.push({ from: Math.max(span.from, MIN_DAY), to: Math.min(to, MAX_DAY) });
175
+ ranges.push({
176
+ from: span.from,
177
+ to: Math.min(span.to, span.from + 366 * MAX_WINDOW_YEARS - 1),
178
+ });
179
+ if (rule.effectiveTo !== null)
180
+ ranges.push(side(rule.effectiveTo + 1, false));
181
+ if (rule.effectiveFrom !== null)
182
+ ranges.push(side(rule.effectiveFrom - 1, true));
183
+ }
184
+ if (inside) {
185
+ for (const e of inside.edges)
186
+ ranges.push(side(e - 1, true), side(e, false));
187
+ ranges.push(...inside.spans);
141
188
  }
142
189
  }
190
+ for (let i = 0; i < ranges.length; i++)
191
+ ranges[i] = { from: Math.max(ranges[i].from, MIN_DAY), to: Math.min(ranges[i].to, MAX_DAY) };
192
+ for (let i = ranges.length - 1; i >= 0; i--)
193
+ if (ranges[i].from > ranges[i].to)
194
+ ranges.splice(i, 1);
143
195
  ranges.sort((a, b) => a.from - b.from);
144
196
  const merged = [];
145
197
  for (const r of ranges) {
@@ -151,10 +203,28 @@ function scanWindow(source, rules, cycle) {
151
203
  }
152
204
  const yearOf = (n) => parseDate(fromDayNumber(n)).year;
153
205
  const label = merged.map((r) => `${yearOf(r.from)}-${yearOf(r.to)}`).join(", ");
154
- return { ranges: merged, label };
206
+ return { ranges: merged, label, blind: false };
155
207
  }
156
- export function rulesScanWindow(compiled, cycle = patternCycle(compiled.recurring)) {
157
- return scanWindow(compiled.source, [...compiled.annual, ...compiled.recurring], cycle);
208
+ export function rulesScanWindow(compiled) {
209
+ const source = compiled.source;
210
+ const rules = [...compiled.annual, ...compiled.recurring];
211
+ const inside = { edges: [], spans: [], rules: [] };
212
+ const known = compiled.recurring.every((r) => r.calendar === null || collectBasis(r.calendar, inside));
213
+ const own = patternCycle(compiled.recurring);
214
+ const cycle = patternCycle([...compiled.recurring, ...inside.rules]);
215
+ const window = known ? scanWindow(source, rules, cycle, inside) : scanWindow(source, rules, own);
216
+ if (!window)
217
+ return window;
218
+ const max = 366 * MAX_WINDOW_YEARS;
219
+ const days = window.ranges.reduce((sum, r) => sum + r.to - r.from + 1, 0);
220
+ const blind = !known ||
221
+ (cycle >= max && own < max) ||
222
+ days > MAX_SCAN_DAYS ||
223
+ (inside.rules.some((r) => r.interval !== null || r.cycle !== null) &&
224
+ window.ranges.some(crossesShortCentury));
225
+ if (!blind)
226
+ return window;
227
+ return { ...(known ? scanWindow(source, rules, own) : window), blind };
158
228
  }
159
229
  function eachDay(window, fn) {
160
230
  for (const { from, to } of window.ranges) {
@@ -395,8 +465,8 @@ export function unjudgeableDays(compiled, window) {
395
465
  }
396
466
  return { days, months };
397
467
  }
398
- export function unsureOf(compiled, unknown) {
399
- if (unknown.days.size === 0)
468
+ export function unsureOf(compiled, unknown, blind = false) {
469
+ if (unknown.days.size === 0 && !blind)
400
470
  return () => false;
401
471
  const sorted = [...unknown.days].sort((a, b) => a - b);
402
472
  const overlaps = (start, end) => {
@@ -432,6 +502,8 @@ export function unsureOf(compiled, unknown) {
432
502
  return false;
433
503
  if (isDate(item))
434
504
  return overlaps(item.from, item.to);
505
+ if (blind)
506
+ return true;
435
507
  return overlaps(item.effectiveFrom, item.effectiveTo);
436
508
  };
437
509
  }
@@ -479,10 +551,11 @@ export function dropUnsure(c, from, unsure, recorded, unknown) {
479
551
  throw internalError(`a diagnostic about an unjudgeable month was left: ${left.code} ${left.path}`);
480
552
  }
481
553
  function analyze(c, original, isCalendar) {
482
- const unknown = unjudgeableDays(original, rulesScanWindow(original));
554
+ const window = rulesScanWindow(original);
555
+ const unknown = unjudgeableDays(original, window);
483
556
  const recorded = new Set();
484
557
  const compiled = guardBases(original, recorded);
485
- const unsure = unsureOf(original, unknown);
558
+ const unsure = unsureOf(original, unknown, window?.blind);
486
559
  const from = c.issues.length;
487
560
  analyzeRules(c, compiled, isCalendar, unsure);
488
561
  dropUnsure(c, from, unsure, recorded, unknown);
@@ -497,7 +570,7 @@ function analyzeRules(c, compiled, isCalendar, unsure = () => false) {
497
570
  });
498
571
  const basis = createBasis(compiled, lookup);
499
572
  const cycle = patternCycle(recurring);
500
- const window = rulesScanWindow(compiled, cycle);
573
+ const window = rulesScanWindow(compiled);
501
574
  const unused = new Set();
502
575
  checkLostShifts(c, compiled, lookup, window);
503
576
  dates.forEach((rule, j) => {
@@ -545,7 +618,9 @@ function analyzeRules(c, compiled, isCalendar, unsure = () => false) {
545
618
  c.warning("shadowed", rule.path, `This rule is never used: the earlier rule ${annual[k].path} covers all of its days`, annual[k].path);
546
619
  });
547
620
  const noBits = new Uint8Array(PATTERN_DAYS);
548
- const recurringBits = recurring.map((r) => (r.businessDays !== null ? noBits : patternBits(r)));
621
+ const recurringBits = [];
622
+ const bitsOf = (j) => (recurringBits[j] ??=
623
+ recurring[j].businessDays !== null ? noBits : patternBits(recurring[j]));
549
624
  const holidayOfSafe = (date) => {
550
625
  try {
551
626
  return lookup.holidayOfDate(date);
@@ -615,7 +690,6 @@ function analyzeRules(c, compiled, isCalendar, unsure = () => false) {
615
690
  a.skipWeekdays.size === b.skipWeekdays.size &&
616
691
  [...a.skipWeekdays].every((w) => b.skipWeekdays.has(w));
617
692
  recurring.forEach((rule, j) => {
618
- const bits = recurringBits[j];
619
693
  const holidayBased = isHolidayBasedRule(rule);
620
694
  const businessDayBased = rule.businessDays !== null;
621
695
  const matches = holidayBased
@@ -688,7 +762,7 @@ function analyzeRules(c, compiled, isCalendar, unsure = () => false) {
688
762
  r.businessDays === null &&
689
763
  r.cycle === null &&
690
764
  intervalCovers(r, rule) &&
691
- isSubset(bits, recurringBits[i])));
765
+ isSubset(bitsOf(j), bitsOf(i))));
692
766
  if (k < 0)
693
767
  return;
694
768
  unused.add(rule);
@@ -802,7 +876,9 @@ function analyzeRules(c, compiled, isCalendar, unsure = () => false) {
802
876
  const decided = [];
803
877
  const span = [];
804
878
  let checked = 0;
805
- const last = Math.min(rule.to, rule.from + MAX_DATE_RULE_DAYS - 1);
879
+ if (rule.to - rule.from + 1 > MAX_DATE_RULE_DAYS)
880
+ return false;
881
+ const last = rule.to;
806
882
  for (let n = rule.from; n <= last; n++) {
807
883
  span.push(n);
808
884
  let decidedBy;
@@ -1122,6 +1122,15 @@ export function mapDays(from, to, fn) {
1122
1122
  return Object.freeze(result);
1123
1123
  }
1124
1124
  const INTERNAL_INFO = Symbol("bizdays-toolkit.scheduleInfo");
1125
+ export const PARTS = Symbol("bizdays-toolkit.parts");
1126
+ export const partsHolder = (value) => ({
1127
+ owner: undefined,
1128
+ value,
1129
+ });
1130
+ export function partsOf(object) {
1131
+ const holder = object[PARTS];
1132
+ return holder?.owner === object ? holder.value : undefined;
1133
+ }
1125
1134
  const INTERNAL_VALUES = Symbol("bizdays-toolkit.scheduleValues");
1126
1135
  export function valuesOfSchedule(schedule) {
1127
1136
  return schedule[INTERNAL_VALUES] ?? [];
@@ -1136,9 +1145,11 @@ export function buildSchedule(compiled) {
1136
1145
  const values = Object.freeze(typeof compiled.holiday === "object" && "value" in compiled.holiday
1137
1146
  ? [...compiled.weekly, compiled.holiday.value]
1138
1147
  : [...compiled.weekly]);
1148
+ const parts = partsHolder(compiled);
1139
1149
  const schedule = {
1140
1150
  [INTERNAL_INFO]: info,
1141
1151
  [INTERNAL_VALUES]: values,
1152
+ [PARTS]: parts,
1142
1153
  timeZone: lookup.timeZone,
1143
1154
  providers: lookup.providers,
1144
1155
  outOfRangePolicy: lookup.outOfRangePolicy,
@@ -1159,6 +1170,8 @@ export function buildSchedule(compiled) {
1159
1170
  dayInfo: (input) => info(lookup.dateOf(input)),
1160
1171
  daysBetween: (from, to) => mapDays(lookup.dateOf(from), lookup.dateOf(to), info),
1161
1172
  };
1173
+ parts.owner = schedule;
1174
+ Object.freeze(parts);
1162
1175
  return Object.freeze(schedule);
1163
1176
  }
1164
1177
  export function createSchedule(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bizdays-toolkit",
3
- "version": "0.32.4",
3
+ "version": "0.32.6",
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",