Skip to content

fix(deps): update dependency date-fns to v4 - #55

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/date-fns-4.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/date-fns-4.x

Conversation

@renovate

@renovate renovate Bot commented Sep 23, 2024

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
date-fns ^3.6.0^4.4.0 age confidence

Release Notes

date-fns/date-fns (date-fns)

v4.4.0

Compare Source

This release revisits the approach to CDN usage and introduces a new package, @date-fns/cdn and deprecates the date-fns CDN scripts. It allowed reducing the zipped package size from 5.83 MB down to 3.96 MB without introducing any breaking changes.

In v5.0.0-alpha.0 where CDN scripts are completely removed from date-fns the change is more significant and brings the zipped package size down to 2.89 MB.

It is just the first step in optimizing the package size. Expect further size reduction in the future v4 and v5 versions.

Changed
  • 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 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.

v4.3.0

Compare Source

Kudos to @​ImRodry and @​puneetdixit200 for their contributions.

Fixed

v4.2.1

Compare Source

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

v4.2.0

Compare Source

This is a minor release in all senses, it only includes documentation updates (first of many) that points to the new You Don't Need date-fns* page.

* Not really

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

v4.1.0

Compare Source

This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.

Make sure also upgrade TZDate to v1.0.2 as it includes a bunch of critical bug fixes.

Fixed
  • 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
  • Added missing time zone support to format, formatISO, formatISO9075, formatRelative and formatRFC3339. See #​3886.

v4.0.0

Compare Source

I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.

Another great news is that there aren't many breaking changes in this release. All of them are type-related and will affect only those explicitly using internal date-fns types. Finally, it has been less than a year since the last major release, which is an improvement over the previous four years between v2 and v3. I plan on keeping the pace and minimizing breaking changes moving forward.

Read more about the release in the announcement blog post.

- Sasha @​kossnocorp

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

  • 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:

    import { addDays, startOfDay } from "date-fns";
    import { tz } from "@date-fns/tz";
    
    startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));
    //=> "2024-09-16T00:00:00.000+08:00"

    In the example, addDays will get the current date and time in Singapore and add 5 days to it. startOfDay will inherit the date type and return the start of the day in Singapore.

Changed
  • 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).

    The functions will normalize these values, make calculations, and return the result in the same type, preventing any bugs caused by the discrepancy. If passed, the type will be inferred from the context in option or the first encountered argument object type. The Interval's start and end will be considered separately, starting from start.

    In the given example, the result will be in the TZDate as the first argument is a number, and the start takes precedence over the end.

    clamp(Date.now(), {
      start: new TZDate(start, "Asia/Singapore"),
      end: new UTCDate(),
    });
    //=> TZDate
  • 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.

Fixed
  • Fixed CDN build compatibility with jQuery and other tools that expose $ by properly wrapping the code in an IIFE.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • Between 12:00 AM and 03:59 AM, only on Monday (* 0-3 * * 1)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 2 times, most recently from 643494f to 0f71142 Compare August 13, 2025 16:58
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 0f71142 to 936fc64 Compare August 31, 2025 11:26
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 2 times, most recently from 7aeb9d3 to 0efeabe Compare September 29, 2025 05:11
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 0efeabe to fd39f75 Compare October 21, 2025 11:48
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from fd39f75 to c3cbdbd Compare November 10, 2025 19:05
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from c3cbdbd to e7cec5a Compare December 3, 2025 14:51
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from e7cec5a to 2b985c9 Compare December 31, 2025 16:53
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 2b985c9 to 5f15528 Compare January 19, 2026 16:30
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 5f15528 to 3ca2791 Compare February 2, 2026 19:46
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 2 times, most recently from 8553285 to 7f4ae5f Compare February 16, 2026 05:31
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 7f4ae5f to 56c0ff9 Compare March 5, 2026 15:10
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 56c0ff9 to ca8898d Compare March 13, 2026 10:50
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 2 times, most recently from 1ea1635 to 3453575 Compare April 1, 2026 18:37
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 3453575 to 3f3a2b1 Compare April 8, 2026 18:56
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 3f3a2b1 to ef1d068 Compare April 29, 2026 18:32
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 3 times, most recently from a8955c9 to 5aab1fe Compare May 23, 2026 14:44
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from 5aab1fe to f5244aa Compare May 30, 2026 01:52
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch 2 times, most recently from 702d149 to c196ace Compare July 16, 2026 14:54
@renovate
renovate Bot force-pushed the renovate/date-fns-4.x branch from c196ace to 5123245 Compare September 7, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants