Small tweak to handle swapped dates
This commit is contained in:
@@ -16,8 +16,9 @@ export const useReservationStore = defineStore('reservation', () => {
|
|||||||
start: string = today(),
|
start: string = today(),
|
||||||
end: string = start
|
end: string = start
|
||||||
) => {
|
) => {
|
||||||
const startDate = new Date(start + 'T00:00');
|
const startDate = new Date(start < end ? start : end + 'T00:00');
|
||||||
const endDate = new Date(end + 'T23:59');
|
const endDate = new Date(start < end ? end : start + 'T23:59');
|
||||||
|
|
||||||
if (getUnloadedDates(startDate, endDate).length === 0) return;
|
if (getUnloadedDates(startDate, endDate).length === 0) return;
|
||||||
|
|
||||||
setDateLoaded(startDate, endDate, 'pending');
|
setDateLoaded(startDate, endDate, 'pending');
|
||||||
|
|||||||
Reference in New Issue
Block a user