Call an event on next month


#1

Hi,

I would like to call an url when clicking the button next month (in month view)
image
Is that possible? Thank you in advance :slight_smile:
Sara


#2

Hi,

You can add onclick event to the next button container in the scheduler’s markup
https://docs.dhtmlx.com/scheduler/scheduler_markup.html
Then call the function, check the currently opened view using getState() method and call url if it is month view
https://docs.dhtmlx.com/scheduler/api__scheduler_getstate.html


#3

Thank you very much for your help! Is that possible to get the month number (1 to 12) when I call the next or previous button? I’m able to get the max or min date (formatFunc(scheduler.getState().min_date)) and extract the month but I want to get the current month in view.


#4

As I understand your question, you need to use ‘date’ parameter of getState() method to get the active date

scheduler.getState().date;