date-fns
4.4.0 · 29 May 2026MIT126.2M / weekRepositorynpmAtom feed
Upgrading date-fns From 3.6.0 to 4.0.0
1 release in betweenevery note read
- 2
- changes to make
- 0
- advisories fixed
- 2
- new
- 1
- fix
Before you upgrade
Tick each one off as you go- Breaking4.0.0
- Breaking4.0.0
Release by release
- Breaking
This release contains a bunch of types changes that should not affect the library's expected usage. The changes are primarily internal and nuanced, so rather than listing them here, I recommend you run the type checker after the upgrade. If there are unfixable problems, please open an issue.
- Breaking
The package is now ESM-first. CommonJS is still supported, and it should not affect most users, but it might break in certain environments. If you encounter any issues, please report them.
- New
Added time zones support via
@date-fns/tz'sTZDateclass andtzhelper function. See its README for the details about the API. - New
All relevant functions now accept the context
inoption, which allows to specify the time zone to make the calculations in. If the function also returns a date, it will be in the specified time zone: - Fixed
Fixed CDN build compatibility with jQuery and other tools that expose
$by properly wrapping the code in an IIFE.
- Breaking
1 other line we could not sort, mostly version bumps
- 4.0.0
The function arguments, as well as
Interval'sstartandend, now can be of different types, allowing you to mixUTCDate,TZDate,Date, and other extensions, as well as primitives (strings and numbers).
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.