elysia-logging
elysia-logging copied to clipboard
[Snyk] Upgrade date-fns from 3.6.0 to 4.1.0
Snyk has created this PR to upgrade date-fns from 3.6.0 to 4.1.0.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
⚠️ Warning: This PR contains major version upgrade(s), and may be a breaking change.
-
The recommended version is 4 versions ahead of your current version.
-
The recommended version was released on a month ago.
Release notes
Package name: date-fns
-
4.1.0 - 2024-09-17
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
TZDateto v1.0.2 as it includes a bunch of critical bug fixes.Fixed
- Fixed internal
constructFromthrowing an exception onnullarguments. Whilenullisn't allowed, the functions should rather returnInvalid DateorNaNin such cases. See #3885.
Added
- Added missing time zone support to
format,formatISO,formatISO9075,formatRelativeandformatRFC3339. See #3886.
- Fixed internal
-
4.0.0 - 2024-09-16
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.
Added
-
Added time zones support via
@ date-fns/tz'sTZDateclass andtzhelper function. See its README for the details about the API. -
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: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,
addDayswill get the current date and time in Singapore and add 5 days to it.startOfDaywill inherit the date type and return the start of the day in Singapore.
Changed
-
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).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
inoption or the first encountered argument object type. TheInterval'sstartandendwill be considered separately, starting fromstart.In the given example, the result will be in the
TZDateas the first argument is a number, and thestarttakes precedence over theend.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.
-
- 4.0.0-beta.1 - 2024-09-14
- 4.0.0-alpha.1 - 2024-09-11
-
3.6.0 - 2024-03-18
On this release worked @ kossnocorp and @ world1dan. Also, thanks to @ seated for sponsoring me.
Fixed
Added
[!IMPORTANT]
- Warning: This PR contains a major version upgrade, and may be a breaking change.
- Check the changes in this PR to ensure they won't cause issues with your project.
- This PR was automatically created by Snyk using the credentials of a real user.
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information: