Fetch data from backend

This commit is contained in:
2022-05-03 23:02:34 +02:00
parent 6444f09ae3
commit 9c4a09fadc
3 changed files with 61 additions and 7 deletions

View File

@ -51,14 +51,14 @@ function getColor(type) {
</template>
</span>
<span class="text" v-else>
{{ getSubstitutionText(event.data) }}
{{ getSubstitutionText(event.change) }}
<span class="notes">
{{ event.data.notes ? uiTexts.substitutionNotes + ": " : "" }}
{{ event.data.notes }}
{{ event.change.notes ? uiTexts.substitutionNotes + ": " : "" }}
{{ event.change.notes }}
</span>
</span>
<span class="notes">
{{ dayjs(event.changedAt).format("DD.MM.YYYY, HH:mm") }}
{{ dayjs(event.updatedAt).format("DD.MM.YYYY, HH:mm") }}
</span>
</div>
</div>

View File

@ -3,8 +3,10 @@ import { parsedTimetable, substitutions } from "../store";
import { dayNames } from "../definitions";
import { getSubstitutionColor } from "../util";
import { computed, ref } from "vue";
import dayjs from "dayjs";
const timetableDay = ref(0);
const timetableDate = ref(new Date());
const timetableDay = computed(() => timetableDate.value.getDay() - 1);
const timetable = computed(() => {
const currentDay = parsedTimetable.value[timetableDay.value];
@ -36,7 +38,10 @@ function isCancelled(substitution) {
<template>
<div class="timetable">
<div class="title">
<span class="day">{{ dayNames[timetableDay] }}</span>
<span class="day">
{{ dayNames[timetableDay] }},
{{ dayjs(timetableDate).format("DD.MM.YYYY") }}
</span>
</div>
<template v-for="(lesson, index) in timetable" :key="index">