🐛 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>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { history, loadingFailed } from "@/store";
|
||||
import { history, loadingFailed, classFilter } from "@/store";
|
||||
import { getSubstitutionText } from "@/util";
|
||||
import { computed } from "vue";
|
||||
import dayjs from "dayjs";
|
||||
@@ -65,13 +65,19 @@ const chars = {
|
||||
<!-- If the entry is an addition or deletion generate a text -->
|
||||
<span class="text" v-else
|
||||
>{{
|
||||
$t(getSubstitutionText(event.change), {
|
||||
subject: event.change.change.subject,
|
||||
class: event.change.class.join(", "),
|
||||
teacher: event.change.teacher,
|
||||
new_teacher: event.change.change.teacher,
|
||||
room: event.change.change.room,
|
||||
})
|
||||
$t(
|
||||
getSubstitutionText(
|
||||
event.change,
|
||||
!classFilter || classFilter == "none"
|
||||
),
|
||||
{
|
||||
subject: event.change.change.subject,
|
||||
class: event.change.class.join(", "),
|
||||
teacher: event.change.teacher,
|
||||
new_teacher: event.change.change.teacher,
|
||||
room: event.change.change.room,
|
||||
}
|
||||
)
|
||||
}}<span class="notes" v-if="event.change.notes">
|
||||
{{ $t("timetable.notes") }} {{ event.change.notes }}
|
||||
</span>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { substitutions, loadingFailed } from "@/store";
|
||||
import { substitutions, loadingFailed, classFilter } from "@/store";
|
||||
import { getSubstitutionText, getSubstitutionColor } from "@/util";
|
||||
import { computed } from "vue";
|
||||
import InfoCard from "@/components/info-card.vue";
|
||||
@@ -46,13 +46,19 @@ const substitutionsForDate = computed(() => {
|
||||
<span class="hour">{{ substitution.lesson }}</span>
|
||||
<div class="infos">
|
||||
<span class="text">{{
|
||||
$t(getSubstitutionText(substitution), {
|
||||
subject: substitution.change.subject,
|
||||
class: substitution.class.join(", "),
|
||||
teacher: substitution.teacher,
|
||||
new_teacher: substitution.change.teacher,
|
||||
room: substitution.change.room,
|
||||
})
|
||||
$t(
|
||||
getSubstitutionText(
|
||||
substitution,
|
||||
!classFilter || classFilter == "none"
|
||||
),
|
||||
{
|
||||
subject: substitution.change.subject,
|
||||
class: substitution.class.join(", "),
|
||||
teacher: substitution.teacher,
|
||||
new_teacher: substitution.change.teacher,
|
||||
room: substitution.change.room,
|
||||
}
|
||||
)
|
||||
}}</span>
|
||||
<span class="notes" v-if="substitution.notes">
|
||||
{{ $t("timetable.notes") }} {{ substitution.notes }}
|
||||
|
||||
Reference in New Issue
Block a user