minor with calendar

This commit is contained in:
lesion 2022-02-26 21:28:08 +01:00
parent cf3e1c69fa
commit 3568797fd1
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 7 additions and 10 deletions

View file

@ -1,17 +1,18 @@
<template lang="pug">
#calendar
vc-calendar(
vc-date-picker(
v-model='selectedDate'
title-position='left'
:is-dark="settings['theme.is_dark']"
:columns="$screens({ sm: 2 }, 1)"
@input='click'
@update:from-page='updatePage'
:locale='$i18n.locale'
:attributes='attributes'
transition='fade'
aria-label='Calendar'
is-expanded
is-inline
@dayclick='click')
is-inline)
</template>
<script>
@ -28,6 +29,7 @@ export default {
const month = dayjs().month() + 1
const year = dayjs().year()
return {
selectedDate: null,
page: { month, year }
}
},

View file

@ -15,7 +15,7 @@
.col.pt-0.pt-md-2
Search(:filters='filters' @update='updateFilters')
v-chip(v-show='selectedDay' close :close-icon='mdiCloseCircle' @click:close='dayChange({ date: selectedDay})') {{selectedDay}}
v-chip(v-if='selectedDay' close :close-icon='mdiCloseCircle' @click:close='dayChange({ date: selectedDay})') {{selectedDay}}
//- Events
#events.mb-2.mt-1.pl-1.pl-sm-2
@ -175,12 +175,7 @@ export default {
this.setFilters(filters)
},
dayChange (day) {
const date = dayjs(day.date).format('YYYY-MM-DD')
if (this.selectedDay === date) {
this.selectedDay = null
return
}
this.selectedDay = date
this.selectedDay = day ? dayjs(day).format('YYYY-MM-DD') : null
}
}
}