Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): Bump date-fns from 3.6.0 to 4.1.0 (#102)
Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.6.0 to 4.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/date-fns/date-fns/releases">date-fns's releases</a>.</em></p> <blockquote> <h2>v4.1.0</h2> <p>This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.</p> <p>Make sure also upgrade <code>TZDate</code> to v1.0.2 as it <a href="https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14">includes a bunch of critical bug fixes</a>.</p> <h3>Fixed</h3> <ul> <li>Fixed internal <code>constructFrom</code> throwing an exception on <code>null</code> arguments. While <code>null</code> isn't allowed, the functions should rather return <code>Invalid Date</code> or <code>NaN</code> in such cases. See <a href="https://redirect.github.com/date-fns/date-fns/issues/3885">#3885</a>.</li> </ul> <h3>Added</h3> <ul> <li>Added missing time zone support to <code>format</code>, <code>formatISO</code>, <code>formatISO9075</code>, <code>formatRelative</code> and <code>formatRFC3339</code>. See <a href="https://redirect.github.com/date-fns/date-fns/issues/3886">#3886</a>.</li> </ul> <h2>v4.0.0</h2> <p>I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.</p> <p>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.</p> <p><a href="https://blog.date-fns.org/v40-with-time-zone-support/">Read more about the release in the announcement blog post</a>.</p> <p>- <a href="https://twitter.com/kossnocorp"><code>Sasha @kossnocorp</code></a></p> <h3>Added</h3> <ul> <li> <p>Added time zones support via <a href="https://github.com/date-fns/tz"><code>@date-fns/tz</code></a>'s <code>TZDate</code> class and <code>tz</code> helper function. See its <a href="https://github.com/date-fns/tz">README</a> for the details about the API.</p> </li> <li> <p>All relevant functions now accept the context <code>in</code> 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:</p> <pre lang="ts"><code>import { addDays, startOfDay } from "date-fns"; import { tz } from "@date-fns/tz"; <p>startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));<br /> //=> "2024-09-16T00:00:00.000+08:00"<br /> </code></pre></p> <p>In the example, <code>addDays</code> will get the current date and time in Singapore and add 5 days to it. <code>startOfDay</code> will inherit the date type and return the start of the day in Singapore.</p> </li> </ul> <h3>Changed</h3> <ul> <li> <p>The function arguments, as well as <code>Interval</code>'s <code>start</code> and <code>end</code>, now can be of different types, allowing you to mix <code>UTCDate</code>, <code>TZDate</code>, <code>Date</code>, and other extensions, as well as primitives (strings and numbers).</p> <p>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 <code>in</code> option or the first encountered argument object type. The <code>Interval</code>'s <code>start</code> and <code>end</code> will be considered separately, starting from <code>start</code>.</p> <p>In the given example, the result will be in the <code>TZDate</code> as the first argument is a number, and the <code>start</code> takes precedence over the <code>end</code>.</p> <pre lang="ts"><code>clamp(Date.now(), { start: new TZDate(start, "Asia/Singapore"), end: new UTCDate(), </code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/date-fns/date-fns/blob/main/CHANGELOG.md">date-fns's changelog</a>.</em></p> <blockquote> <h2>v4.1.0 - 2024-09-17</h2> <p>This release adds time zone support to format functions (that I somehow missed when working on the feature) and fixes a few bugs.</p> <p>Make sure also upgrade <code>TZDate</code> to v1.0.2 as it <a href="https://github.com/date-fns/tz/blob/main/CHANGELOG.md#v102---2024-09-14">includes a bunch of critical bug fixes</a>.</p> <h3>Fixed</h3> <ul> <li>Fixed internal <code>constructFrom</code> throwing an exception on <code>null</code> arguments. While <code>null</code> isn't allowed, the functions should rather return <code>Invalid Date</code> or <code>NaN</code> in such cases. See <a href="https://redirect.github.com/date-fns/date-fns/issues/3885">#3885</a>.</li> </ul> <h3>Added</h3> <ul> <li>Added missing time zone support to <code>format</code>, <code>formatISO</code>, <code>formatISO9075</code>, <code>formatRelative</code> and <code>formatRFC3339</code>. See <a href="https://redirect.github.com/date-fns/date-fns/issues/3886">#3886</a>.</li> </ul> <h2>v4.0.0 - 2024-09-16</h2> <p>I have great news! First, ten years after its release, date-fns finally gets first-class time zone support.</p> <p>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.</p> <p><a href="https://blog.date-fns.org/v40-with-time-zone-support/">Read more about the release in the announcement blog post</a>.</p> <p>- <a href="https://twitter.com/kossnocorp"><code>Sasha @kossnocorp</code></a></p> <h3>Added</h3> <ul> <li> <p>Added time zones support via <a href="https://github.com/date-fns/tz"><code>@date-fns/tz</code></a>'s <code>TZDate</code> class and <code>tz</code> helper function. See its <a href="https://github.com/date-fns/tz">README</a> for the details about the API.</p> </li> <li> <p>All relevant functions now accept the context <code>in</code> 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:</p> <pre lang="ts"><code>import { addDays, startOfDay } from "date-fns"; import { tz } from "@date-fns/tz"; <p>startOfDay(addDays(Date.now(), 5, { in: tz("Asia/Singapore") }));<br /> //=> "2024-09-16T00:00:00.000+08:00"<br /> </code></pre></p> <p>In the example, <code>addDays</code> will get the current date and time in Singapore and add 5 days to it. <code>startOfDay</code> will inherit the date type and return the start of the day in Singapore.</p> </li> </ul> <h3>Changed</h3> <ul> <li> <p>The function arguments, as well as <code>Interval</code>'s <code>start</code> and <code>end</code>, now can be of different types, allowing you to mix <code>UTCDate</code>, <code>TZDate</code>, <code>Date</code>, and other extensions, as well as primitives (strings and numbers).</p> <p>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 <code>in</code> option or the first encountered argument object type. The <code>Interval</code>'s <code>start</code> and <code>end</code> will be considered separately, starting from <code>start</code>.</p> <p>In the given example, the result will be in the <code>TZDate</code> as the first argument is a number, and the <code>start</code> takes precedence over the <code>end</code>.</p> <pre lang="ts"><code>clamp(Date.now(), { </code></pre> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/date-fns/date-fns/commit/313b902b9a72c64501074db9bc2b9897d2db5140"><code>313b902</code></a> Fix v4.1.0 change log entry</li> <li><a href="https://github.com/date-fns/date-fns/commit/26cd336cc239cf543337ac33f3ae5367d3292469"><code>26cd336</code></a> Promote to v4.1.0</li> <li><a href="https://github.com/date-fns/date-fns/commit/97b53b97e993c6d6aadcdc31b9042397a4c00f03"><code>97b53b9</code></a> Cover time zone edge cases</li> <li><a href="https://github.com/date-fns/date-fns/commit/59b756385a205d554c9799fa7b28a0c52ddc0281"><code>59b7563</code></a> Add missing time zone support to format, formatISO, formatISO9075, formatRela...</li> <li><a href="https://github.com/date-fns/date-fns/commit/0121164052a65667ef31c0285a48afb8064dfe8b"><code>0121164</code></a> Prevent constructFrom from throwing an error on null</li> <li><a href="https://github.com/date-fns/date-fns/commit/bd87ef5848ebb93c5b3e2f6fc2f7e10b4e72041a"><code>bd87ef5</code></a> Update <code>@date-fns/docs</code></li> <li><a href="https://github.com/date-fns/date-fns/commit/99b4e671d7c9ac21ac3109261d085fe861cec691"><code>99b4e67</code></a> Prepare v4.0</li> <li><a href="https://github.com/date-fns/date-fns/commit/8df1706c6dea84330974df2834ca1c4d379ea44d"><code>8df1706</code></a> Rewrite the time zones doc</li> <li><a href="https://github.com/date-fns/date-fns/commit/e3519776c57034b0e419a39d4f922b773ea8b688"><code>e351977</code></a> Promote to v4.0.0-beta.1</li> <li><a href="https://github.com/date-fns/date-fns/commit/8523656e296102a125d2ff36d4afcf9f6044d855"><code>8523656</code></a> Fix scripts/test/types.sh</li> <li>Additional commits viewable in <a href="https://github.com/date-fns/date-fns/compare/v3.6.0...v4.1.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) 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-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> 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 <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
- Loading branch information