Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
🐛 Fix bug where incorrect end time is shown
Luke Vella712616e0f647
diff --git a/apps/web/src/utils/date-time-utils.ts b/apps/web/src/utils/date-time-utils.tsindex ef9fb8e1c..ef6416a74 100644--- a/apps/web/src/utils/date-time-utils.ts+++ b/apps/web/src/utils/date-time-utils.ts@@ -101,13 +101,16 @@ const parseTimeSlotOption = (timeZone: string | null,targetTimeZone: string,): ParsedTimeSlotOption => {- const start = dayjs(option.start).utc();- const startDate =- timeZone && targetTimeZone- ? start.tz(timeZone, true).tz(targetTimeZone)- : start;+ const adjustTimeZone = (date: Date | dayjs.Dayjs) => {+ return timeZone && targetTimeZone+ ? dayjs(date).utc().tz(timeZone, true).tz(targetTimeZone)+ : dayjs(date).utc();+ };+ const startDate = adjustTimeZone(option.start);- const endDate = startDate.add(option.duration, "minute");+ const endDate = adjustTimeZone(+ dayjs(option.start).add(option.duration, "minute"),+ );return {type: "timeSlot",