This commit is contained in:
lesion
2023-01-12 14:40:14 +01:00
parent 76bb959a80
commit 1f0cacb119
3 changed files with 6 additions and 17 deletions

View File

@@ -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()