🐛 Fix issues with UTC time handling
- Using `.setUTCHours` can cause the day to shift at specific times
This commit is contained in:
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user