♻️ Refactor frontend
This commit is contained in:
@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user