This is a migrated thread and some comments may be shown as answers.

Bug In RadDateTimePicker _onCellClickHandler event

3 Answers 28 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Raheel Ashraf
Top achievements
Rank 1
Raheel Ashraf asked on 23 Dec 2010, 04:34 PM
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:

,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. 

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 28 Dec 2010, 12:19 PM
Hello Raheel,

I tested the scenario which you describe and I reproduced the unwanted behaviour. Our developers are aware and they will start working on the resolution of this issue.
Additionally as a small token of gratitude for your involvement I have updated your Telerik points.

Regards,
Radoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Raheel Ashraf
Top achievements
Rank 1
answered on 04 Jan 2011, 05:34 PM
Thanks..Can you please post here and let us know once its fixed..
thanks
0
Radoslav
Telerik team
answered on 14 Jan 2011, 09:47 AM
Hello Raheel,

I am glad to inform you that the described issue has been fixed and you can download latest internal build from your account. On the following links you could find instructions how to use the hotfix dlls and how to upgrade Telerik's RadControls to another version:
http://www.telerik.com/help/aspnet-ajax/installusinghotfix.html
http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx
I hope this helps.

Regards,
Radoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Calendar
Asked by
Raheel Ashraf
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Raheel Ashraf
Top achievements
Rank 1
Share this question
or