🐛 Fix issues with UTC time handling
- Using `.setUTCHours` can cause the day to shift at specific times
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { ref, watch, computed } from "vue";
|
||||
import { getNextAndPrevDay } from "@/util";
|
||||
import { getNextAndPrevDay, setUTCMidnight } from "@/util";
|
||||
import i18n from "@/i18n";
|
||||
|
||||
/* Router */
|
||||
@ -32,7 +32,7 @@ watch(theme, (newValue) => {
|
||||
});
|
||||
|
||||
/* Date selector */
|
||||
export const selectedDate = ref(new Date(new Date().setUTCHours(0, 0, 0, 0)));
|
||||
export const selectedDate = ref(setUTCMidnight(new Date()));
|
||||
export const selectedDay = computed(() => selectedDate.value.getDay() - 1);
|
||||
// Jump to next Monday if it is weekend
|
||||
if (selectedDay.value == 5)
|
||||
|
Reference in New Issue
Block a user