From 9acdbad570e6383fc3fc1cf0dec1eb8227e60542 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:50:56 +0000 Subject: [PATCH 1/2] Update dependency date-fns to v4 --- frontend/package.json | 2 +- frontend/yarn.lock | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 376659b..3813933 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -43,7 +43,7 @@ "@theme-ui/match-media": "^0.17.0", "axios": "^1.7.4", "boring-avatars": "^1.10.2", - "date-fns": "^2.30.0", + "date-fns": "^4.0.0", "date-fns-tz": "^2.0.1", "framer-motion": "^11.3.29", "i18next": "^24.0.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 8ce9f30..2493874 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -5655,7 +5655,7 @@ __metadata: languageName: node linkType: hard -"date-fns@npm:^2.16.1, date-fns@npm:^2.30.0": +"date-fns@npm:^2.16.1": version: 2.30.0 resolution: "date-fns@npm:2.30.0" dependencies: @@ -5664,6 +5664,13 @@ __metadata: languageName: node linkType: hard +"date-fns@npm:^4.0.0": + version: 4.1.0 + resolution: "date-fns@npm:4.1.0" + checksum: 10/d5f6e9de5bbc52310f786099e18609289ed5e30af60a71e0646784c8185ddd1d0eebcf7c96b7faaaefc4a8366f3a3a4244d099b6d0866ee2bec80d1361e64342 + languageName: node + linkType: hard + "debounce@npm:^1.2.1": version: 1.2.1 resolution: "debounce@npm:1.2.1" @@ -8562,7 +8569,7 @@ __metadata: axios: "npm:^1.7.4" boring-avatars: "npm:^1.10.2" concurrently: "npm:^9.0.0" - date-fns: "npm:^2.30.0" + date-fns: "npm:^4.0.0" date-fns-tz: "npm:^2.0.1" eslint: "npm:9.16.0" eslint-config-airbnb: "npm:^19.0.4" From 3529e6e925d1ffe00334f7648a4a7333d81b0858 Mon Sep 17 00:00:00 2001 From: "mike.toggweiler" Date: Wed, 4 Dec 2024 15:56:45 +0100 Subject: [PATCH 2/2] update date-fns-tz as well, rename functions due to new version --- frontend/package.json | 2 +- frontend/src/lib/api/apiDateHandling.ts | 6 +++--- frontend/yarn.lock | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 3813933..d62249a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -44,7 +44,7 @@ "axios": "^1.7.4", "boring-avatars": "^1.10.2", "date-fns": "^4.0.0", - "date-fns-tz": "^2.0.1", + "date-fns-tz": "^3.2.0", "framer-motion": "^11.3.29", "i18next": "^24.0.0", "js-cookie": "^3.0.5", diff --git a/frontend/src/lib/api/apiDateHandling.ts b/frontend/src/lib/api/apiDateHandling.ts index 6edb191..379dd06 100644 --- a/frontend/src/lib/api/apiDateHandling.ts +++ b/frontend/src/lib/api/apiDateHandling.ts @@ -28,7 +28,7 @@ import { startOfMonth, startOfWeek, } from 'date-fns'; -import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz'; +import { toZonedTime, fromZonedTime } from 'date-fns-tz'; import { ModelsLocalDateTimeWithTimeZone } from 'lib/api/lasius'; import { Granularity } from 'types/common'; @@ -125,7 +125,7 @@ export const modelsLocalDateTimeWithTimeZoneToString = ( m: ModelsLocalDateTimeWithTimeZone ): string => { const isoDate = parseISO(m.dateTime); - const asUtc = zonedTimeToUtc(isoDate, m.zone); - const zoned = utcToZonedTime(asUtc, m.zone); + const asUtc = fromZonedTime(isoDate, m.zone); + const zoned = toZonedTime(asUtc, m.zone); return zoned.toISOString(); }; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 2493874..1c2aa1d 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -5646,12 +5646,12 @@ __metadata: languageName: node linkType: hard -"date-fns-tz@npm:^2.0.1": - version: 2.0.1 - resolution: "date-fns-tz@npm:2.0.1" +"date-fns-tz@npm:^3.2.0": + version: 3.2.0 + resolution: "date-fns-tz@npm:3.2.0" peerDependencies: - date-fns: 2.x - checksum: 10/f12e684bc13c9fe7ef7910c5b25437e15290a655d45102b7420f046cecdf9fa5715bf333d6dfb6bab6c382c7abc6b58241a50c216e9ab0b60d6fdb388f473d6b + date-fns: ^3.0.0 || ^4.0.0 + checksum: 10/8ab4745f00b40381220f0a7a2ec16e217cb629d4018a19047264d289dd260322baa23e19b3ed63c7e553f9ad34bea9dea105391132930a3e141e9a0a53e54af2 languageName: node linkType: hard @@ -8570,7 +8570,7 @@ __metadata: boring-avatars: "npm:^1.10.2" concurrently: "npm:^9.0.0" date-fns: "npm:^4.0.0" - date-fns-tz: "npm:^2.0.1" + date-fns-tz: "npm:^3.2.0" eslint: "npm:9.16.0" eslint-config-airbnb: "npm:^19.0.4" eslint-config-next: "npm:^15.0.0"