Skip to content

v7.0.0

Choose a tag to compare

@elusivecodes elusivecodes released this 16 Aug 01:57
· 23 commits to main since this release

Major release focused on a cleaner immutable API, closer PHP IntlDateFormatter and IntlCalendar compatibility, and reliable timezone behavior across historical and daylight-saving transitions.

Breaking Changes

  • Renamed immutable set*() copy methods to with*(), including setDate() → withDate(), setTimeZone() → withTimeZone(), and related calendar and time setters.
  • Renamed isDST() to isDst().
  • Consolidated the implementation behind the root @fr0st/datetime export; deep imports of internal src/ modules are no longer supported.
  • Updated supported Node.js versions to ^20.19.0, ^22.13.0, or >=24.

Fixed

  • Preserved the instant represented by explicit Z and numeric offsets while treating unzoned ISO dates and date-times as local wall time in the requested timezone.
  • Corrected timezone offsets for years 0 through 99, BC dates, and historical second-precision offsets.
  • Corrected time-only parsing to use January 1, 1970 in the requested local timezone.
  • Made week numbers and relative day and week differences calendar-aware across daylight-saving transitions.
  • Resolved skipped wall times, repeated hours, and fully deleted calendar days consistently with PHP behavior.
  • Forced Gregorian locale formatting and preserved locale region and Unicode rg overrides for week rules.
  • Fixed ICU apostrophe escaping, compact fixed-width numeric parsing, and parsing with non-BMP numbering systems.

Improved

  • Added second-precision fixed-offset parsing and formatting for the corresponding X, x, and Z token widths.
  • Audited token widths against PHP ICU behavior, added explicit unsupported-token errors, and documented the compatibility matrix.
  • Added toJSON() output and DateTime.clearDataCache() for formatter and locale caches.
  • Reworked the internal DateTime implementation and refreshed the README, format reference, JSDoc, tests, and generated bundles.

Tooling

  • Added CI across Node.js 20, 22, and 24 with lint, test, build, generated-bundle, and npm-package validation.
  • Added trusted npm publishing with provenance from GitHub releases.
  • Added focused-test prevention, complete source-map links, and an npm release-age policy.
  • Updated ESLint, Mocha, Rollup, Terser, and the shared Frost ESLint configuration.