Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Fix date and time formatting and tz adjustment (#808)
Luke Vella58a04c63cd1f
diff --git a/apps/web/src/components/event-card.tsx b/apps/web/src/components/event-card.tsxindex e244a8966..ca99ed20d 100644--- a/apps/web/src/components/event-card.tsx+++ b/apps/web/src/components/event-card.tsx@@ -71,7 +71,7 @@ export const EventCard = () => {: `${adjustTimeZone(poll.event.start,!poll.timeZone,- ).format("LLL")} - ${adjustTimeZone(+ ).format("LL LT")} - ${adjustTimeZone(dayjs(poll.event.start).add(poll.event.duration,"minutes",diff --git a/apps/web/src/pages/polls.tsx b/apps/web/src/pages/polls.tsxindex 1dbb4b574..75af7945c 100644--- a/apps/web/src/pages/polls.tsx+++ b/apps/web/src/pages/polls.tsx@@ -121,7 +121,7 @@ const Page: NextPageWithLayout = () => {? `${adjustTimeZone(poll.event.start,!poll.timeZone,- ).format("LLL")} - ${adjustTimeZone(+ ).format("LL LT")} - ${adjustTimeZone(dayjs(poll.event.start).add(poll.event.duration,"minutes",diff --git a/apps/web/src/utils/dayjs.tsx b/apps/web/src/utils/dayjs.tsxindex 9303aa50a..8a326a845 100644--- a/apps/web/src/utils/dayjs.tsx+++ b/apps/web/src/utils/dayjs.tsx@@ -213,10 +213,11 @@ export const DayjsProvider: React.FunctionComponent<{return (<DayjsContext.Providervalue={{- adjustTimeZone: (date, keepLocalTime) =>- keepLocalTime- ? dayjs(date).tz("GMT")- : dayjs(date).tz(preferredTimeZone),+ adjustTimeZone: (date, keepLocalTime) => {+ return keepLocalTime+ ? dayjs(date).utc()+ : dayjs(date).tz(preferredTimeZone);+ },dayjs,locale,timeZone: preferredTimeZone,