Packages

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

Other targets from 3.6.0Latest4.4.0
  1. 3.6.0yours
  2. 4.0.0target
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

  1. 4.0.0

    Migration needed16 Sep 20242 new · 1 fix
    • 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's TZDate class and tz helper function. See its README for the details about the API.

    • New

      All relevant functions now accept the context in option, 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.

1 other line we could not sort, mostly version bumps
  • The function arguments, as well as Interval's start and end, now can be of different types, allowing you to mix UTCDate, TZDate, Date, and other extensions, as well as primitives (strings and numbers).

    4.0.0

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.