adds fix-availability-slot-addition (#7420)
Co-authored-by: Omar López <zomars@me.com>
This commit is contained in:
1 parent
eb93524f49
commit
7d9c21cf9a
1 file changed
+9
-3
@@ -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(),
|
||||
|
||||
Reference in new issue
Block a user