scheduler.date.add_day not getting called?

I’m working on a scheduler which skips weekends in “day” and “timeline” view.
I have the following code for my scheduler:

//why this is not working
scheduler.date.add_day = function(date, inc) {
if ((date.getDay() == 5 && inc > 0) || (date.getDay() == 1 && inc < 0)) { //friday / monday
return scheduler.date.add(date, inc * 3, “day”);
} else {
return scheduler.date.add(date, inc * 1, “day”);
}
}

        scheduler.ignore_day = function(date) {
            if (date.getDay() == 6 || date.getDay() == 0) //hides Saturdays and Sundays
                return true;
        };

        scheduler.date.add_timeline = function(date, inc) {
            if ((date.getDay() == 5 && inc > 0) || (date.getDay() == 1 && inc < 0)) { //friday / monday
                return scheduler.date.add(date, inc * 3, "day");
            } else {
                return scheduler.date.add(date, inc * 1, "day");
            }

        }

While my scheduler.date.add_timeline got called when I navigate, scheduler.date.add_day did not get called at all. And scheduler.ignore_day works well. This makes me so confused. Is this intended or something wrong with my code?

for scheduler.date.add_{view name} see:
docs.dhtmlx.com/scheduler/custom_views.html - 5

Hello,
adding days is one of the basic operations of a scheduler, so there is has no public method to override.
If you want to skip weekends when you scroll day view forward and backward, you could use onBeforeViewChanged event

Here is a demo:
docs.dhtmlx.com/scheduler/snippet/7d420140

Docs:
docs.dhtmlx.com/scheduler/api__s … event.html