I am using ASP.NET AJAX Q1 2010 and I am having some issues with firefox.
Scenario:
I adopted the sample at http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-multimonthview-calendar.aspx and used it with RadTimePicker so the idea is that for selecting date, user can use multiple month calendar and then select time. However, on firefox, if first the user selects date and then selects time, the control renders invalid date (red border with invalid image).
Diagnosis:
So I traced through the code and the problem is in the click handler for the time view..
This is telerik code:
,_onCellClickHandler:function(k){var c=Telerik.Web.UI.Calendar.Utils.FindTarget(k,this.get_id());
if(c!=null){var g=c.cellIndex;
if(navigator.userAgent.match(/Safari/)){var h=c.parentNode;
var a;
for(a=0;
a<h.cells.length;
a++){if(h.cells[a]==c){g=a;
}}}var m=this._findTime(c.parentNode.rowIndex,g);
if(m!=null){this._onCellMouseOutHandler(k);
var j=this.getTime();
if(j!=null){m.setDate(j.getDate());
m.setMonth(j.getMonth());
m.setYear(j.getYear());
}var n=new Telerik.Web.UI.TimeViewSelectingEventArgs(m,j);
var d=this.raise_clientTimeSelecting(n);
if(!d){this.setTime(m.getHours(),m.getMinutes(),m.getSeconds(),m);
......................
The problem is in the bolded line. The getYear api is depreciated and instead getFullYear should be used. as if the date is Jan 5, 2011, on firefox, getYear returns 111 and when you do m.setYear(111), m's date is something wierd.
Now why does this error no manifest in all demos and normal situation is because, in setTime method we have:
in normal scenario, the if condition would be false and hence d=f.get_selectedDate(); is executed. However, since I am using http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-multimonthview-calendar.aspx, d = g is evaluated. And future down in the code, _setHiddenValue is called which actually verifies that the selected date is between min and max and this is where it fails.
Scenario:
I adopted the sample at http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-multimonthview-calendar.aspx and used it with RadTimePicker so the idea is that for selecting date, user can use multiple month calendar and then select time. However, on firefox, if first the user selects date and then selects time, the control renders invalid date (red border with invalid image).
Diagnosis:
So I traced through the code and the problem is in the click handler for the time view..
This is telerik code:
,_onCellClickHandler:function(k){var c=Telerik.Web.UI.Calendar.Utils.FindTarget(k,this.get_id());
if(c!=null){var g=c.cellIndex;
if(navigator.userAgent.match(/Safari/)){var h=c.parentNode;
var a;
for(a=0;
a<h.cells.length;
a++){if(h.cells[a]==c){g=a;
}}}var m=this._findTime(c.parentNode.rowIndex,g);
if(m!=null){this._onCellMouseOutHandler(k);
var j=this.getTime();
if(j!=null){m.setDate(j.getDate());
m.setMonth(j.getMonth());
m.setYear(j.getYear());
}var n=new Telerik.Web.UI.TimeViewSelectingEventArgs(m,j);
var d=this.raise_clientTimeSelecting(n);
if(!d){this.setTime(m.getHours(),m.getMinutes(),m.getSeconds(),m);
......................
The problem is in the bolded line. The getYear api is depreciated and instead getFullYear should be used. as if the date is Jan 5, 2011, on firefox, getYear returns 111 and when you do m.setYear(111), m's date is something wierd.
Now why does this error no manifest in all demos and normal situation is because, in setTime method we have:
,setTime:function(c,a,e,g){var f=$find(this.get__OwnerDatePickerID());
var d;
if(Object.getType(f).getName()=="Telerik.Web.UI.RadDateTimePicker"&&!f.get_calendar()){d=g;
}else{d=f.get_selectedDate();
}if(!d){d=new Date();
}d.setHours(c);
d.setMinutes(a);
d.setSeconds(e);
in normal scenario, the if condition would be false and hence d=f.get_selectedDate(); is executed. However, since I am using http://www.telerik.com/community/code-library/aspnet-ajax/calendar/how-to-use-raddatepicker-with-multimonthview-calendar.aspx, d = g is evaluated. And future down in the code, _setHiddenValue is called which actually verifies that the selected date is between min and max and this is where it fails.