简体   繁体   中英

Fullcalendar prev /next API

I have implemented the fullcaleandar in angular and it is working fine. Usually the prev / next click will update the month/day/week views based on which tab is currently active. But I have custom buttons to increment or decrement week and day values. So I am trying to update the month alone in the fullcalendar prev and next buttons irrespective of the active view tab. ( only because I have other buttons to control the day/week views)

That means even if the calendar is in day/week view, if I am clicking the Fullcalendar next/prev buttons, the month value should increment/decrement -- not the day/week value.

Iam thinking about any option to send month data to the inbuild calendar api which is triggered while calling prev/next? Is it possible to do so as per fullcalendar methods?

Thanks.

It is actually not possible until you try rewriting some part of FullCalendar Code. The Fullcalendar documentation suggests that increment and decrement depends on the current view. Ideally, the use case (even the API provided by FullCalendar) suggests that, If month is the view then, 1 month is incremented. If is a week view, 1 week in incremented. You may try finding some workarounds but, I don't think there are any.

One suggested workaround is to:

  • Get the current date FullCalendar is displaying
  • Get the current View ('timeGridDay', etc.)
  • Then use the changeView method by incrementing the dateOrRange object

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM