From c9243bad41155d14b49cf37252216f2e79c2fcf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:00:45 -0400 Subject: [PATCH] Bump date-fns from 3.6.0 to 4.1.0 (#133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [date-fns](https://github.com/date-fns/date-fns) from 3.6.0 to 4.1.0.
Release notes

Sourced from date-fns's releases.

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.

Fixed

Added

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.

- Sasha @​kossnocorp

Added

Changed

... (truncated)

Changelog

Sourced from date-fns's changelog.

v4.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 TZDate to v1.0.2 as it includes a bunch of critical bug fixes.

Fixed

Added

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.

Read more about the release in the announcement blog post.

- Sasha @​kossnocorp

Added

Changed

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=date-fns&package-manager=npm_and_yarn&previous-version=3.6.0&new-version=4.1.0)](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) ---
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 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)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nat Welch --- package.json | 5 ++--- public/sitemap-0.xml | 2 +- src/components/Age.tsx | 17 ++++++++--------- src/components/Footer.tsx | 5 +++-- yarn.lock | 23 +++++++++-------------- 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index a789ace..9cd086b 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,17 @@ "author": "Nat Welch ", "homepage": "https://natwelch.com", "dependencies": { + "@date-fns/tz": "^1.0.2", "@heroicons/react": "^2.0.18", "@mdx-js/react": "^3.0.0", "@next/env": "^14.0.0", "@root/walk": "^1.1.0", "contentlayer2": "^0.5.0", "daisyui": "^4.7.3", - "date-fns": "^3.0.0", + "date-fns": "^4.1.0", "gray-matter": "^4.0.3", "isomorphic-unfetch": "^4.0.0", "lodash": "^4.17.21", - "luxon": "^3.0.0", "next": "^14.0.0", "next-contentlayer2": "^0.5.0", "next-secure-headers": "^2.1.0", @@ -48,7 +48,6 @@ "@babel/core": "^7.0.0", "@tailwindcss/typography": "^0.5.10", "@types/lodash": "^4.14.178", - "@types/luxon": "^3.0.0", "@types/mdx": "^2.0.2", "@types/react": "^18.2.12", "@types/react-dom": "^18.0.4", diff --git a/public/sitemap-0.xml b/public/sitemap-0.xml index 766fdf3..756d7a3 100644 --- a/public/sitemap-0.xml +++ b/public/sitemap-0.xml @@ -1,5 +1,6 @@ +https://natwelch.com/wikimonthly0.7 https://natwelch.com/wiki/aboutmonthly0.7 https://natwelch.com/wiki/booksmonthly0.7 https://natwelch.com/wiki/books/locative.gardenmonthly0.7 @@ -36,5 +37,4 @@ https://natwelch.com/wiki/talksmonthly0.7 https://natwelch.com/wiki/writingmonthly0.7 https://natwelch.commonthly0.7 -https://natwelch.com/wikimonthly0.7 \ No newline at end of file diff --git a/src/components/Age.tsx b/src/components/Age.tsx index 8f6702e..57a979d 100644 --- a/src/components/Age.tsx +++ b/src/components/Age.tsx @@ -1,15 +1,14 @@ -import { DateTime } from "luxon"; +import { TZDate } from "@date-fns/tz"; +import { differenceInCalendarYears, formatISO } from "date-fns"; export default function Age() { - const birth = DateTime.fromObject( - { year: 1988, month: 2, day: 22, hour: 17 }, - { zone: "America/Los_Angeles" } - ); - const now = DateTime.now(); - const diff = now.diff(birth, "years", { conversionAccuracy: "longterm" }); + const birth = new TZDate(1988, 2, 22, 17, "America/Los_Angeles"); + + const now = Date.now(); + const diff = differenceInCalendarYears(now, birth); if (birth && now && diff) { - const birthString = birth.toISO() ?? ""; - return ; + const birthString = formatISO(birth); + return ; } return <>; diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index e6b0218..dc4aa97 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,5 +1,6 @@ import "./rc.css"; +import { TZDate } from "@date-fns/tz"; import { CodeBracketIcon, DocumentCheckIcon, @@ -14,8 +15,8 @@ const Footer = () => {