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

@ -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">