Skip to content

Scheduling infrastructure for absolutely everyone.

adds fix-availability-slot-addition (#7420)

Shafkathullah Ihsan7d9c21cf9a54
diff --git a/packages/features/schedules/components/Schedule.tsx b/packages/features/schedules/components/Schedule.tsx
index 049c15670dd..af6be32a306 100644
--- a/packages/features/schedules/components/Schedule.tsx
+++ b/packages/features/schedules/components/Schedule.tsx
@@ -346,10 +346,16 @@ const useOptions = () => {
};
const getNextRange = (field?: FieldArrayWithId) => {
- const nextRangeStart = dayjs((field as unknown as TimeRange).end);
- const nextRangeEnd = dayjs(nextRangeStart).add(1, "hour");
+ const nextRangeStart = dayjs((field as unknown as TimeRange).end).utc();
+ const nextRangeEnd =
+ nextRangeStart.hour() === 23
+ ? dayjs(nextRangeStart).add(59, "minutes").add(59, "seconds").add(999, "milliseconds")
+ : dayjs(nextRangeStart).add(1, "hour");
- if (nextRangeEnd.isBefore(nextRangeStart.endOf("day"))) {
+ if (
+ nextRangeEnd.isBefore(nextRangeStart.endOf("day")) ||
+ nextRangeEnd.isSame(nextRangeStart.endOf("day"))
+ ) {
return {
start: nextRangeStart.toDate(),
end: nextRangeEnd.toDate(),