✨ Implement day navigation gestures with Swiper.js
This commit is contained in:
@ -1,8 +1,7 @@
|
||||
<script setup>
|
||||
import { selectedDate, selectedDay } from "../store";
|
||||
import { selectedDate, selectedDay, changeDay, changeDate } from "../store";
|
||||
import ArrowIcon from "./icons/arrow-icon.vue";
|
||||
import dayjs from "dayjs";
|
||||
import { changeDate, previousDay, nextDay } from "../util";
|
||||
|
||||
const dayNames = [
|
||||
"days.sunday",
|
||||
@ -17,12 +16,15 @@ const dayNames = [
|
||||
|
||||
<template>
|
||||
<div class="selector">
|
||||
<ArrowIcon @click="previousDay" />
|
||||
<span class="day" @click="changeDate(dayjs())">
|
||||
<ArrowIcon @click="() => (changeDay -= 1)" />
|
||||
<span class="day" @click="changeDate = dayjs().toDate()">
|
||||
{{ $t(dayNames[selectedDay + 1]) }},
|
||||
{{ dayjs(selectedDate).format("DD.MM.YYYY") }}
|
||||
</span>
|
||||
<ArrowIcon style="transform: rotate(180deg)" @click="nextDay" />
|
||||
<ArrowIcon
|
||||
style="transform: rotate(180deg)"
|
||||
@click="() => (changeDay += 1)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user