fix: calendar day filter

This commit is contained in:
Alexandro Uc Santos
2024-12-20 20:11:49 -06:00
parent 68f2599cdd
commit 7092ab388c

View File

@@ -103,8 +103,14 @@ import { useAuthStore } from '../stores/auth';
const handleUpdatedPeriod = async(ev) => { const handleUpdatedPeriod = async(ev) => {
const global = filter.value.value === 'general' ? 1 : 0; const global = filter.value.value === 'general' ? 1 : 0;
let start = new Date(ev.start);
let end = new Date(ev.end);
startDate.value = formatOnlyDate(ev.start) startDate.value = formatOnlyDate(ev.start)
endDate.value = formatOnlyDate(ev.end) endDate.value = formatOnlyDate(ev.end)
if( (start.getMonth() === end.getMonth()) && (start.getDate() === end.getDate()) ) {
startDate.value = formatOnlyDate(start) + ' 00:00:00';
endDate.value = formatOnlyDate(end) + ' 23:59:59';
}
await getCalendarDate(startDate.value, endDate.value, global); await getCalendarDate(startDate.value, endDate.value, global);
mapLoadsToEvents() mapLoadsToEvents()
} }