Changelog - 2026-10-15
TemporalHelper covers what a dayjs wrapper did
Feature Bug Fix Breaking ChangeIn one line. An app can call TemporalHelper directly instead of keeping its own date wrapper.
typescript
temporal.format({ value: row.paidAt, pattern: 'DD/MM/YYYY', fallback: '--' }); // '--' when paidAt is null
temporal.startOf({ value, unit: TemporalUnits.QUARTER });
temporal.set({ value, hour: 9, minute: 0 });
temporal.isBetween({ value, from, to, inclusivity: '[]' });
temporal.formatDuration({ milliseconds, pattern: 'mm:ss' });
const english = temporal.clone({ locale: 'en-US' });
temporal.fromWallClock({ value: pickedDay }); // the picked day, kept in the helper's zoneWhat changed
nullis a 400 (bug fix).toDate,compareandformatanswered 1970 fornull, andisValid(null)wastrue. Nownullis a 400 andisValidisfalse.- Reading without throwing.
tryToDate({ value })answersnull.format({ ..., fallback })writes the fallback for a value that is not a date. The constructor takes afallbacktoo, used byformatandformatIntlwhen a call passes none. - Quarter.
TemporalUnits.QUARTERworks inadd,startOf,endOf,diff,compareandrelative; theQtoken writes 1-4. setreplaces wall-clock fields in the zone; the day clamps to the month.- Comparisons.
isBefore,isAfter,isSame,isSameOrBefore,isSameOrAfter, andisBetweenwith(),[],[)or(]. - Durations.
formatDurationtakes a clock-facepattern(HH:mm:ss,mm:ss) andmaxUnits. - Locales.
clone({ locale, tz }). The constructor'snamesreplacesIntl's month and weekday names and AM/PM marker per locale, and a call in another tag of the same language uses the entry. Theddtoken writes the narrowest weekday. - Date pickers.
fromWallClock({ value })moves a picker's host-zone wall clock into the helper's zone,toWallClockfeeds it back, andTemporalHelper.getHostTz()names the host's zone. addtakes a fraction for an hour or smaller (1.5 hours is 90 minutes). A calendar unit still takes whole numbers only.diffis counted as dayjs counts (behavior change): days by the wall clocks, months anchored on the later day of the month.diff(a, b)is always-diff(b, a).
Breaking changes
WARNING
timeZone is now tz everywhere on TemporalHelper and ITemporalAdapter: the constructor, every per-call option, getTz() (was getTimeZone()), TemporalHelper.getHostTz(), DEFAULT_TEMPORAL_TZ, and getOffsetMilliseconds({ value, tz }). Intl's own timeZone option is unchanged.
Rename timeZone to tz: new TemporalHelper({ tz: 'Asia/Ho_Chi_Minh' }), format({ value, tz: 'UTC' }). A custom adapter reads opts.tz.
Who is affected
- Every caller that passes a zone. Rename
timeZonetotz. - Code that passed
nulland got 1970. It now gets a 400. UsetryToDate,isValidorformat({ fallback })where a date may be missing. - A
diffin months or years that ends on a month end. A few month-end cases change by one. From 2026-02-28 back to 2024-02-29 was -23 months and is now -24, as dayjs answers. - Everyone else. No change.