This commit is contained in:
lesion 2023-01-12 14:40:14 +01:00
parent 76bb959a80
commit 1f0cacb119
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 6 additions and 17 deletions

View file

@ -4,7 +4,9 @@
<v-main> <v-main>
<Snackbar/> <Snackbar/>
<Confirm/> <Confirm/>
<nuxt keep-alive :keep-alive-props="{include: ['Index']}"/> <v-fade-transition hide-on-leave>
<nuxt />
</v-fade-transition>
</v-main> </v-main>
<Footer/> <Footer/>

View file

@ -27,24 +27,11 @@ export default {
end: this.end end: this.end
}) })
}, },
activated() {
if (!this.isCurrentMonth) {
this.start = dayjs().startOf('month').unix()
this.end = null
this.$fetch()
this.isCurrentMonth = true
return
}
if (this.$fetchState.timestamp <= (Date.now() - 60000)) {
this.$fetch()
}
},
data () { data () {
return { return {
mdiMagnify, mdiCloseCircle, mdiMagnify, mdiCloseCircle,
isCurrentMonth: true, isCurrentMonth: true,
now: dayjs().unix(), now: dayjs().unix(),
// date: dayjs.tz().format('YYYY-MM-DD'),
start: dayjs().startOf('month').unix(), start: dayjs().startOf('month').unix(),
end: null, end: null,
tmpEvents: [], tmpEvents: [],
@ -130,10 +117,8 @@ export default {
if (month - 1 === dayjs.tz().month() && year === dayjs.tz().year()) { if (month - 1 === dayjs.tz().month() && year === dayjs.tz().year()) {
isCurrentMonth = true isCurrentMonth = true
this.start = dayjs().startOf('month').unix() this.start = dayjs().startOf('month').unix()
// this.date = dayjs.tz().format('YYYY-MM-DD')
} else { } else {
isCurrentMonth = false isCurrentMonth = false
// this.date = ''
this.start = dayjs().year(year).month(month - 1).startOf('month').unix() // .startOf('week').unix() this.start = dayjs().year(year).month(month - 1).startOf('month').unix() // .startOf('week').unix()
} }
this.end = dayjs().year(year).month(month).endOf('month').unix() // .endOf('week').unix() this.end = dayjs().year(year).month(month).endOf('month').unix() // .endOf('week').unix()

View file

@ -54,7 +54,9 @@ export const actions = {
// this method is called server side only for each request for nuxt // this method is called server side only for each request for nuxt
// we use it to get configuration from db, set locale, etc... // we use it to get configuration from db, set locale, etc...
nuxtServerInit ({ commit }, { _req, res }) { nuxtServerInit ({ commit }, { _req, res }) {
commit('setSettings', res.locals.settings) if (res.locals && res.locals.settings) {
commit('setSettings', res.locals.settings)
}
commit('setFilter', { type: 'show_recurrent', commit('setFilter', { type: 'show_recurrent',
value: res.locals.settings.allow_recurrent_event && res.locals.settings.recurrent_event_visible }) value: res.locals.settings.allow_recurrent_event && res.locals.settings.recurrent_event_visible })