minor
This commit is contained in:
parent
76bb959a80
commit
1f0cacb119
3 changed files with 6 additions and 17 deletions
|
@ -4,7 +4,9 @@
|
|||
<v-main>
|
||||
<Snackbar/>
|
||||
<Confirm/>
|
||||
<nuxt keep-alive :keep-alive-props="{include: ['Index']}"/>
|
||||
<v-fade-transition hide-on-leave>
|
||||
<nuxt />
|
||||
</v-fade-transition>
|
||||
</v-main>
|
||||
<Footer/>
|
||||
|
||||
|
|
|
@ -27,24 +27,11 @@ export default {
|
|||
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 () {
|
||||
return {
|
||||
mdiMagnify, mdiCloseCircle,
|
||||
isCurrentMonth: true,
|
||||
now: dayjs().unix(),
|
||||
// date: dayjs.tz().format('YYYY-MM-DD'),
|
||||
start: dayjs().startOf('month').unix(),
|
||||
end: null,
|
||||
tmpEvents: [],
|
||||
|
@ -130,10 +117,8 @@ export default {
|
|||
if (month - 1 === dayjs.tz().month() && year === dayjs.tz().year()) {
|
||||
isCurrentMonth = true
|
||||
this.start = dayjs().startOf('month').unix()
|
||||
// this.date = dayjs.tz().format('YYYY-MM-DD')
|
||||
} else {
|
||||
isCurrentMonth = false
|
||||
// this.date = ''
|
||||
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()
|
||||
|
|
|
@ -54,7 +54,9 @@ export const actions = {
|
|||
// this method is called server side only for each request for nuxt
|
||||
// we use it to get configuration from db, set locale, etc...
|
||||
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',
|
||||
value: res.locals.settings.allow_recurrent_event && res.locals.settings.recurrent_event_visible })
|
||||
|
||||
|
|
Loading…
Reference in a new issue