✨ Switch to global date selector
This commit is contained in:
@ -1,39 +1,34 @@
|
||||
<script setup>
|
||||
import { substitutionsForDate } from "../store";
|
||||
import dayjs from "dayjs";
|
||||
import { dayNames, uiTexts } from "../definitions";
|
||||
import { substitutionsForDate, selectedDate } from "../store";
|
||||
import { uiTexts } from "../definitions";
|
||||
import { getSubstitutionText, getSubstitutionColor } from "../util";
|
||||
import { computed } from "vue";
|
||||
|
||||
const substitutions = computed(() => {
|
||||
return substitutionsForDate.value[selectedDate.value.setUTCHours(0, 0, 0, 0)];
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="substitutions">
|
||||
<template v-for="(substitutions, date) of substitutionsForDate" :key="date">
|
||||
<div class="title">
|
||||
<span class="day">
|
||||
{{ dayNames[new Date(parseInt(date)).getDay() - 1] }},
|
||||
{{ dayjs(parseInt(date)).format("DD.MM.YYYY") }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<template v-for="(substitution, index) in substitutions" :key="index">
|
||||
<div class="substitution" :style="getSubstitutionColor(substitution)">
|
||||
<span class="hour">{{ substitution.lesson }}</span>
|
||||
<div class="infos">
|
||||
<span class="text">{{ getSubstitutionText(substitution) }}</span>
|
||||
<span class="notes">
|
||||
{{ substitution.notes ? uiTexts.substitutionNotes + ": " : "" }}
|
||||
{{ substitution.notes }}
|
||||
</span>
|
||||
</div>
|
||||
<template v-for="substitution in substitutions" :key="substitution">
|
||||
<div class="substitution" :style="getSubstitutionColor(substitution)">
|
||||
<span class="hour">{{ substitution.lesson }}</span>
|
||||
<div class="infos">
|
||||
<span class="text">{{ getSubstitutionText(substitution) }}</span>
|
||||
<span class="notes">
|
||||
{{ substitution.notes ? uiTexts.substitutionNotes + ": " : "" }}
|
||||
{{ substitution.notes }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.substitutions {
|
||||
padding: 65px 10px 80px 10px;
|
||||
padding: 0px 10px 80px 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
|
Reference in New Issue
Block a user