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
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.
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";
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(),
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 - 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.
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";
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.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the tools group in /frontend with 3 updates: date-fns, marked and pdfmake.
Updates
date-fns
from 3.6.0 to 4.1.0Release notes
Sourced from date-fns's releases.
... (truncated)
Changelog
Sourced from date-fns's changelog.
... (truncated)
Commits
313b902
Fix v4.1.0 change log entry26cd336
Promote to v4.1.097b53b9
Cover time zone edge cases59b7563
Add missing time zone support to format, formatISO, formatISO9075, formatRela...0121164
Prevent constructFrom from throwing an error on nullbd87ef5
Update@date-fns/docs
99b4e67
Prepare v4.08df1706
Rewrite the time zones doce351977
Promote to v4.0.0-beta.18523656
Fix scripts/test/types.shUpdates
marked
from 12.0.1 to 14.1.2Release notes
Sourced from marked's releases.
... (truncated)
Commits
0309c2f
chore(release): 14.1.2 [skip ci]9d7b728
fix: fix html following list (#3444)2fe4136
chore: update testutils to v14.1.1-0 (#3443)f3c387f
chore(release): 14.1.1 [skip ci]9ed6456
fix: Don't replace tabs with spaces (#3438)2ff0547
chore(deps-dev): Bump@markedjs/eslint-config
from 1.0.1 to 1.0.2 (#3442)e6167a9
chore(deps-dev): Bump rollup from 4.21.0 to 4.21.2 (#3441)2124b5d
chore: update@marked/testutils
(#3431)e6f0ca5
chore(deps-dev): Bump eslint from 9.9.0 to 9.9.1 (#3430)73d21f4
chore(deps-dev): Bump tslib from 2.6.3 to 2.7.0 (#3429)Updates
pdfmake
from 0.2.10 to 0.2.12Release notes
Sourced from pdfmake's releases.
Changelog
Sourced from pdfmake's changelog.
Commits
dc73c5a
0.2.12757735f
fixed error message of bad image definitiond0d8133
0.2.11c40c0b2
refresh pdfs examples107d298
Update CHANGELOG.md07ec20b
backport PR #2764508d120
Update CHANGELOG.md95240e0
backport PR #2762d8f0ff0
Update CHANGELOG.mdc7caabb
Merge pull request #2733 from estanglerbm/stylecontext_autopush_faster_overrideDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show