-
-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: bump up date-fns version to v4 #8405
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Your org has enabled the Graphite merge queue for merging into masterAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 204c84a. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
size-limit report 📦
|
Merge activity
|
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [date-fns](https://github.com/date-fns/date-fns) | [`^3.6.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/date-fns/3.6.0/4.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/date-fns/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/date-fns/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/date-fns/3.6.0/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/date-fns/3.6.0/4.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>date-fns/date-fns (date-fns)</summary> ### [`v4.1.0`](https://github.com/date-fns/date-fns/blob/HEAD/CHANGELOG.md#v410---2024-09-17) [Compare Source](https://github.com/date-fns/date-fns/compare/v4.0.0...v4.1.0) 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](https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14). ##### 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](https://github.com/date-fns/date-fns/issues/3885). ##### Added - Added missing time zone support to `format`, `formatISO`, `formatISO9075`, `formatRelative` and `formatRFC3339`. See [#​3886](https://github.com/date-fns/date-fns/issues/3886). ### [`v4.0.0`](https://github.com/date-fns/date-fns/blob/HEAD/CHANGELOG.md#v400---2024-09-16) [Compare Source](https://github.com/date-fns/date-fns/compare/v3.6.0...v4.0.0) 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](https://blog.date-fns.org/v40-with-time-zone-support/). \- [Sasha @​kossnocorp](https://twitter.com/kossnocorp) ##### Added - Added time zones support via [`@date-fns/tz`](https://github.com/date-fns/tz)'s `TZDate` class and `tz` helper function. See its [README](https://github.com/date-fns/tz) 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: ```ts 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`. ```ts 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 running the type checker after the upgrade. If there are unfixable problems, please [open an issue](https://github.com/date-fns/date-fns/issues/new). - **BREAKING**: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please [report them](https://github.com/date-fns/date-fns/issues/new). ##### Fixed - Fixed CDN build compatibility with jQuery and other tools that expose `$` by properly wrapping the code in an IIFE. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/blocksuite). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
244a385
to
204c84a
Compare
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
This PR contains the following updates:
^3.6.0
->^4.0.0
Release Notes
date-fns/date-fns (date-fns)
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
constructFrom
throwing an exception onnull
arguments. Whilenull
isn't allowed, the functions should rather returnInvalid Date
orNaN
in such cases. See #3885.Added
format
,formatISO
,formatISO9075
,formatRelative
andformatRFC3339
. 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
'sTZDate
class andtz
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: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
'sstart
andend
, now can be of different types, allowing you to mixUTCDate
,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. TheInterval
'sstart
andend
will be considered separately, starting fromstart
.In the given example, the result will be in the
TZDate
as the first argument is a number, and thestart
takes precedence over theend
.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 running the type checker after the upgrade. If there are unfixable problems, please open an issue.
BREAKING: The package now is ESM-first. The CommonJS is still support and It should not affect most users, but it might break in certains environments. If you encounter any issues, please report them.
Fixed
$
by properly wrapping the code in an IIFE.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.