Packages

date-fns

4.4.0 · 29 May 2026MIT126.2M / weekRepositorynpmAtom feed

Your version

138 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.4.0

    29 May 2026
    • Deprecated

      DEPRECATED: The date-fns CDN scripts are now deprecated and will be removed in the next major release. Please switch to the new @date-fns/cdn package for CDN usage.

    • Removed

      Removed CDN source maps to reduce the package size. If you rely on them, please switch to the new @date-fns/cdn package that still includes them.

  3. 4.3.0

    22 May 2026
    • Fixed missing modularized optimization fallback (for Next.js and others). See #4193.

    • Fixed pt locale first day of week to be Sunday. See #4195

    • Fixed zh-CN, zh-HK, and zh-TW locale month parsing for October, November, and December. See #4194

  4. 4.2.1

    18 May 2026
    • Fixed type definitions missing in v4.2.0 due to TypeScript misconfiguration.

  5. 4.2.0

    18 May 2026
    • Added Temporal API references to the JSDoc annotations of add, addBusinessDays, and addDays.

  6. 4.1.0

    17 Sep 2024
    • Fixed internal constructFrom throwing an exception on null arguments. While null isn't allowed, the functions should rather return Invalid Date or NaN in such cases. See #3885.

    • Added missing time zone support to format, formatISO, formatISO9075, formatRelative and formatRFC3339. See #3886.

  7. 4.0.0

    16 Sep 2024
    • 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.

    • Added time zones support via @date-fns/tz's TZDate class and tz helper function. See its README for the details about the API.

  8. 3.x
  9. 3.4.0

    11 Mar 2024
  10. 3.3.1

    22 Jan 2024
    • Fixed DST issue in getOverlappingDaysInIntervals, resulting in an inconsistent number of days returned for intervals starting and ending in different DST periods.

    • Fixed functions incorrectly using trunc instead of round. The bug was introduced in v3.3.0. The affected functions: differenceInCalendarDays, differenceInCalendarISOWeeks, differenceInCalendarWeeks, getISOWeek, getWeek, and getISOWeeksInYear.

  11. 3.3.0

    20 Jan 2024
    • Fixed the bug in getOverlappingDaysInIntervals caused by incorrect sorting of interval components that led to 0 for timestamps of different lengths.

    • Fixed bugs when working with negative numbers caused by using Math.floor (-1.1 → -2) instead of Math.trunc (-1.1 → -1). Most of the conversion functions (i.e., hoursToMinutes) were affected when passing some negative fractional input. Also, some other functions that could be possibly affected by unfortunate timezone/date combinations were fixed.

      The functions that were affected: format, parse, getUnixTime, daysToWeeks, hoursToMilliseconds, hoursToMinutes, hoursToSeconds, milliseconds, minutesToMilliseconds, millisecondsToMinutes, monthsToYears, millisecondsToHours, millisecondsToSeconds, minutesToHours, minutesToSeconds, yearsToQuarters, yearsToMonths, yearsToDays, weeksToDays, secondsToMinutes, secondsToHours, quartersToYears, quartersToMonths and monthsToQuarters.

  12. 3.2.0

    9 Jan 2024
  13. 3.1.0

    5 Jan 2024
  14. 3.0.4

    21 Dec 2023
    • Fixed isWithinInterval bug caused by incorrectly sorting dates (#3623).

  15. 3.0.3

    21 Dec 2023
    • Rolled back pointing ESM types to the same d.ts files. Instead, now it copies the content to avoid the Masquerading as CJS problem reported by "Are the types wrong?".

  16. 3.0.2

    21 Dec 2023
  17. 3.0.1

    19 Dec 2023
    • Fixed an error in certain environments caused by d.mts files exporting only types.

  18. 3.0.0

    18 Dec 2023
    • Breaking

      date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the package.json. The ESM files now have .mjs extension.

    • Breaking

      The package now has a flat structure, meaning functions are now named node_modules/date-fns/add.mjs, locales are node_modules/date-fns/locale/enUS.mjs, etc.

    • Breaking

      Now all file content’s exported via named exports instead of export default, which will require change direct imports i.e. const addDays = require(‘date-fns/addDays’) to const { addDays } = require(‘date-fns/addDays’).

  19. 2.x
  20. 2.30.0

    30 Apr 2023
    • Fixed increased build size after enabling compatibility with older browsers in the previous release. This was done by adding @babel/runtime as a dependency. See more details.

  21. 2.29.0

    22 Jul 2022
  22. 2.22.1

    28 May 2021
    • Fixed constant typings.

  23. 2.22.0

    28 May 2021
  24. 2.20.1

    9 Apr 2021
    • Fixed isDate Flow typings that we broke in v2.20.0.

  25. 2.16.1

    31 Aug 2020

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.