Skip to content

Commit

Permalink
Merge pull request #1562 from nextcloud/bugfix/678/update_today
Browse files Browse the repository at this point in the history
Update Today in calendar-grid
  • Loading branch information
georgehrke authored Oct 22, 2019
2 parents 194798d + e65c1b5 commit 5e11216
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/views/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ export default {
return {
loadingCalendars: true,
timeFrameCacheExpiryJob: null,
updateTodayJob: null,
updateTodayJobPreviousDate: null,
showEmptyCalendarScreen: false
}
},
Expand Down Expand Up @@ -254,6 +256,22 @@ export default {
})
}
}, 1000 * 60)

this.updateTodayJob = setInterval(() => {
const newDate = getYYYYMMDDFromFirstdayParam('now')

if (this.updateTodayJobPreviousDate === null) {
this.updateTodayJobPreviousDate = newDate
return
}

if (this.updateTodayJobPreviousDate !== newDate) {
this.updateTodayJobPreviousDate = newDate

const calendarApi = this.$refs.fullCalendar.getApi()
calendarApi.render()
}
}, 1000)
},
beforeMount() {
this.$store.commit('loadSettingsFromServer', {
Expand Down

0 comments on commit 5e11216

Please sign in to comment.