fix: wrong slot starting times for half hour times zones (#10161)

* fix timezone zone issue for first slot

* fix failed test in getSchedule

* Update apps/web/test/lib/getSchedule.test.ts

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: alannnc <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-07-18 00:57:34 +00:00
1 parent dad4fd17fb
commit 2db4998eaa
3 files changed
+24 -2

No files matched your search

+3 -1
View File
@@ -451,6 +451,7 @@ describe("getSchedule", () => {
endTime: `${plus2DateString}T18:29:59.999Z`,
timeZone: Timezones["+5:30"],
});
expect(scheduleForEventWith30Length).toHaveTimeSlots(
[
`04:00:00.000Z`,
@@ -484,8 +485,9 @@ describe("getSchedule", () => {
timeZone: Timezones["+5:30"],
});
// `slotInterval` takes precedence over `length`
// 4:30 is utc so it is 10:00 in IST
expect(scheduleForEventWith30minsLengthAndSlotInterval2hrs).toHaveTimeSlots(
[`04:00:00.000Z`, `06:00:00.000Z`, `08:00:00.000Z`, `10:00:00.000Z`, `12:00:00.000Z`],
[`04:30:00.000Z`, `06:30:00.000Z`, `08:30:00.000Z`, `10:30:00.000Z`, `12:30:00.000Z`],
{
dateString: plus2DateString,
}