Completed
Last Updated: 17 Apr 2018 10:33 by ADMIN
ADMIN
Peter Milchev
Created on: 17 May 2017 16:52
Category: Scheduler
Type: Bug Report
0
In MobileRender mode, navigation using the calendar is to the wrong day
When the timezone of the client is before UTC (e.g. UTC -1 or UTC -3) if you use the calendar for navigation, you will be navigated to the day before the selected one.
1 comment
ADMIN
Peter Milchev
Posted on: 25 Jan 2018 09:33
The problem is in Telerik.Web.UI.RadScheduler.prototype._nativeCalendarBlur  where the new Date() method creates a date and converts it to the local timezone, hence the difference in the date ( 2017.1.2 00:00 in UTC is 2017.1.1 23:00 in UTC-1)

Тhe workaround is to use the following override: 

Telerik.Web.UI.RadScheduler.prototype._nativeCalendarBlur = function (l) {
    var k = new Date(l.target.value);
    k = new Date(k.getUTCFullYear(), k.getUTCMonth(), k.getUTCDate());
    var j = new Telerik.Web.UI.Scheduler.NavigationCommandEventArgs(Telerik.Web.UI.SchedulerNavigationCommand.NavigateToSelectedDate, k);
    this.raiseEvent("navigationCommand", j);
    if (j.get_cancel()) {
        l.target.value = this._datePickerOriginalValue;
        return;
    }
    if (this._renderingManager) {
        this.set_selectedDate(k);
        j = new Telerik.Web.UI.Scheduler.NavigationCompleteEventArgs(Telerik.Web.UI.SchedulerNavigationCommand.NavigateToSelectedDate);
        this.raiseEvent("navigationComplete", j);
    } else {
        var m = {
            Command: "NavigateToSelectedDate",
            StartDate: k.format("yyyyMMddHHmm")
        };
        this.postback(m);
    }
}