Jump to next monday if it is weekend on pageload

This commit is contained in:
2022-08-21 20:02:40 +02:00
parent ebce0bcab3
commit 9e9cf8618d

View File

@ -26,6 +26,11 @@ watch(language, (newValue) => {
export const selectedDate = ref(new Date(new Date().setUTCHours(0, 0, 0, 0)));
export const selectedDay = computed(() => selectedDate.value.getDay() - 1);
// Jump to next Monday if it is weekend
if (selectedDay.value == 5)
selectedDate.value = new Date(selectedDate.value.getTime() + 86400000 * 2);
if (selectedDay.value == -1)
selectedDate.value = new Date(selectedDate.value.getTime() + 86400000);
export const timetable = ref({ trusted: true });
export const substitutions = ref([]);