✨ Fetch data from backend
This commit is contained in:
@ -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">
|
||||
|
Reference in New Issue
Block a user