🐛 Fix issues with UTC time handling

- Using `.setUTCHours` can cause the day to shift at specific times
This commit is contained in:
2023-06-11 23:54:18 +02:00
parent dee01cc21a
commit dac0d09167
5 changed files with 40 additions and 24 deletions

View File

@ -3,7 +3,7 @@ import { selectedDate, changeDate, changeDay } from "@/store";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Virtual } from "swiper";
import { ref, watch } from "vue";
import { getDateSkippingWeekend } from "@/util";
import { getDateSkippingWeekend, setUTCMidnight } from "@/util";
import ScrollableContainer from "@/components/scrollable-container.vue";
defineProps({
@ -89,7 +89,7 @@ watch(changeDay, (change) => {
changeDay.value = 0;
});
watch(changeDate, (date) => {
slideToDate(new Date(date.setUTCHours(0, 0, 0, 0)));
slideToDate(setUTCMidnight(date));
});
</script>