Skip to content

Commit

Permalink
update date-fns-tz as well, rename functions due to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
toggm committed Dec 4, 2024
1 parent 9acdbad commit 3529e6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/api/apiDateHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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();
};
12 changes: 6 additions & 6 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3529e6e

Please sign in to comment.