Replace react-spring with motion, fix breaking changes in react-window/date-fns-tz/pure-rand.

This commit is contained in:
Mike Cao committed 2026-04-18 15:41:25 -07:00
1 parent df29c16c00
commit cc829c8f6f
9 files changed
+132 -110

No files matched your search

+5 -5
View File
@@ -1,4 +1,4 @@
import { formatInTimeZone, utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';
import { formatInTimeZone, fromZonedTime, toZonedTime } from 'date-fns-tz';
import { TIMEZONE_CONFIG, TIMEZONE_LEGACY } from '@/lib/constants';
import { getTimezone } from '@/lib/date';
import { setItem } from '@/lib/storage';
@@ -61,19 +61,19 @@ export function useTimezone() {
};
const toUtc = (date: Date | string | number) => {
return zonedTimeToUtc(date, timezone);
return fromZonedTime(date, timezone);
};
const fromUtc = (date: Date | string | number) => {
return utcToZonedTime(date, timezone);
return toZonedTime(date, timezone);
};
const localToUtc = (date: Date | string | number) => {
return zonedTimeToUtc(date, localTimeZone);
return fromZonedTime(date, localTimeZone);
};
const localFromUtc = (date: Date | string | number) => {
return utcToZonedTime(date, localTimeZone);
return toZonedTime(date, localTimeZone);
};
const canonicalizeTimezone = (timezone: string): string => {