Problem with scheduler.setCurrentView()

Hello !

I have a problem with scheduler.setCurrentView () function.

My goal is that when I am in the month view, when I click on the day number, the calendar displays the week of the day.

So I have my function:

scheduler.templates.month_day = function(date) {
    return '<a class="number_day_month_view" onClick="go_to_week(\'' + date + '\')">' + date.getDate() + '</a>';

And the go-to_week function here:

function go_to_week(date) {
    scheduler.setCurrentView(date, 'week');

This code works but then I can not change the day / week / month with two arrows.
In the javascript console the error is : TypeError: a.getDay is not a function.

For informations, the button “today” works perfectly.

Thank you !

You need to have a Date object as parameter of setCurrentView, not a string.

Also, there is a “Active Links” extension, with similar functionality

Oh thank you !

Very good product ! :slight_smile: