What the fuck just happened

This commit is contained in:
Laurent
2025-03-10 20:50:03 +01:00
parent d97b306c32
commit 242b186cb3
2 changed files with 4 additions and 14 deletions

View File

@@ -17,7 +17,7 @@
})
watch(selectedDays, (newValue) => {
let dates = Array.from(selectedDays.value.values())
let dates = Array.from(newValue.values())
datePicker.update(dates);
}, { deep: true });
@@ -26,19 +26,6 @@
calendar.setDay(day);
toggleSelectedDay(event.target.id, calendar.getDate());
highlightSelectedDay(event.target);
checkConsistency();
}
function checkConsistency(){
let selected = selectedDays.value;
let stored = datePicker.value;
if(selected.size != stored.length){
datePicker.clear();
selected.clear();
router.push('/error')
}
}
function toggleSelectedDay(id : string, date : Date) : void {

View File

@@ -9,6 +9,9 @@ export const datePickerStore = defineStore('datePicker', {
value: (state) : TimeStamp[] => state.dates as TimeStamp[],
},
actions: {
getValue(){
return this.dates;
},
update(dates : Date[]) : void {
this.dates = dates.map(date => new TimeStamp(date));
},