✨ Jump to next monday if it is weekend on pageload
This commit is contained in:
@ -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([]);
|
||||
|
Reference in New Issue
Block a user