♻️ Refactor frontend

This commit is contained in:
2022-12-10 16:10:10 +01:00
parent 568bfb9782
commit f243137145
12 changed files with 64 additions and 46 deletions

View File

@ -2,6 +2,7 @@
import { selectedDate, selectedDay, changeDay, changeDate } from "../store";
import ArrowIcon from "./icons/arrow-icon.vue";
import dayjs from "dayjs";
import { getDateSkippingWeekend } from "../util";
const dayNames = [
"days.sunday",
@ -16,15 +17,15 @@ const dayNames = [
<template>
<div class="selector">
<ArrowIcon @click="() => (changeDay -= 1)" />
<span class="day" @click="changeDate = dayjs().toDate()">
<ArrowIcon @click="changeDay--" />
<span
class="day"
@click="changeDate = getDateSkippingWeekend(dayjs().toDate(), true)"
>
{{ $t(dayNames[selectedDay + 1]) }},
{{ dayjs(selectedDate).format("DD.MM.YYYY") }}
</span>
<ArrowIcon
style="transform: rotate(180deg)"
@click="() => (changeDay += 1)"
/>
<ArrowIcon style="transform: rotate(180deg)" @click="changeDay++" />
</div>
</template>