fix timezone filter

This commit is contained in:
lesion
2022-08-07 21:49:59 +02:00
parent 15fb2b457e
commit 3c13a0b22a

View File

@@ -78,8 +78,8 @@ export default {
visibleEvents () {
const now = dayjs().unix()
if (this.selectedDay) {
const min = dayjs(this.selectedDay).startOf('day').unix()
const max = dayjs(this.selectedDay).endOf('day').unix()
const min = dayjs.tz(this.selectedDay).startOf('day').unix()
const max = dayjs.tz(this.selectedDay).endOf('day').unix()
return this.events.filter(e => (e.start_datetime <= max && e.start_datetime >= min))
} else if (this.isCurrentMonth) {
return this.events.filter(e => e.end_datetime ? e.end_datetime > now : e.start_datetime + 2 * 60 * 60 > now)