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

"Date is out of range" error after calling set_maxDate

13 Answers 219 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
R
Top achievements
Rank 1
R asked on 27 May 2009, 11:22 PM
I have two RadDatePickers.  When I select a date on the first one I need the MaxDate set to the selected date on the 2nd one.
The following code sets the MaxDate correctly

function dateSelected(sender, e) { 
   var dateString = e.get_newValue(); 
   var maxdate = new Date(dateString); 
   var postmarkdate = $find("<%= PostMarkDate.ClientID %>"); 
   postmarkdate.set_maxDate(maxdate); 

My error occurs when I set the date on the 1st picker to any date less than the current month and then I click the icon to popup the calendar for the second picker.  Whenever I do this I get a javascript popup with the error: "Date is out of range."

This occurs whether I type in the date or select one from the calendar.

As I said this does not happen if I select a date that falls in the current month.

This does not occur when I already have a date in the 2nd picker, only when it's empty.

The MaxDate is set correctly in the 2nd picker and the 2nd picker calendar that pops up is displaying the correct dates, it just throws the js error.

Whats the issue?

Thanks,

Rob T


13 Answers, 1 is accepted

Sort by
0
R
Top achievements
Rank 1
answered on 29 May 2009, 03:43 PM
Anyone?
0
Tsvetoslav
Telerik team
answered on 30 May 2009, 01:30 PM
Hi Rob,

Indeed, this proved to be a minor issue with the calendar control, that has already been fixed.

Thank you for turning our attention to this behavior of the calendar control.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
R
Top achievements
Rank 1
answered on 01 Jun 2009, 11:34 PM
So does that mean You've now fixed the issue and it will be available in a future release or does that mean that you were aware of the issue, it has already been fixed, and the fix war put out in a previous release?

Thanks,

Rob
0
Tsvetoslav
Telerik team
answered on 02 Jun 2009, 07:25 AM
Hi Rob,

Based on your forum post, I researched the issue and upon reproducing it on my side I reported it to the development team and they fixed it right away.

Best Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Tsvetoslav
Telerik team
answered on 02 Jun 2009, 08:29 AM
Hi Rob,

Excuse me for having missed to point out that the fix should be available in the latest internal build version of the controls.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rob T
Top achievements
Rank 1
answered on 02 Jun 2009, 03:42 PM
Tsvetoslav

Where can I get the fix?  When I navigate to the Latest Internal Build page I see a message:

"No internal builds for RadControls for ASP.NET AJAX 2009.1 527 have been uploaded recently."

Thanks

Rob


0
Rob T
Top achievements
Rank 1
answered on 04 Jun 2009, 04:13 PM
Hello?  I'd really like to know where the fix is.
0
Tsvetoslav
Telerik team
answered on 05 Jun 2009, 08:05 AM
Hello Rob T,

The latest build is already available.

Excuse us for the delay in uploading the build to the telerik site.

All the best,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sachidananda
Top achievements
Rank 1
answered on 23 Aug 2011, 04:59 PM
We are facing this problem with the latest calender control released in 2011. I have a calender control and has to set the raddatepicker.calender.RangeMinDate to 14 days in future.So this works fine if the date is 14 days ahead is within the same month but if it falls in the next month.Then it shows the Date is out of range error.

How can I suppress this javascript alert.
0
Radoslav
Telerik team
answered on 26 Aug 2011, 12:03 PM
Hello Sachidananda,

Based on the supplied information, it is hard to determine what is causing the unwanted behavior at your end. Could you please post your aspx markup code with the related code behind.
Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.

Looking forward for your reply.

Best wishes,
Radoslav
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Ashwini
Top achievements
Rank 1
answered on 25 Jul 2013, 08:22 AM
I am still facing this issue (telerik version - 2011.1.614.35).

I have two RadDatePicker controls radDate1 and radDate2. The min and max dates of both these controls are set when the page is initialized, and they are same i.e. "radDate1's MinDate = radDate2's MinDate = varMinDate". Similarly, MaxDate is same for both controls. When the user changes the date in radDate1, the selectedDate and maxDate of radDate2 are set to the selected date of radDate1. This is done because the date in radDate2 must never exceed the date in radDate1. All this works fine except for one scenario - when user selects the date in radDate1 same as that of MinDate. E.g.,

1. The MinDate of both controls is July 1, 2013. MaxDate can be anything, it doesn't matter for now.
2. User changes the date of radDate1 to July 1, 2013.
3. The  javascript code sets the selectedDate and maxDate of radDate2 to July 1, 2013, and gives an alert message 'Date is out of range'.

Please note, here the MaxDate of radDate1 is also equal to its MinDate. But it works properly as user had manually set the date. Where as, for radDate2, the maxDate is being set through js code (using set_maxDate()), which gives the error.

For now, for this particular scenario, I have fixed this issue by setting the minDate of radDate2 to 1day prior, then set its maxDate and then again reset the minDate to what it was. But, I am really not fond of such hacks. Is there a better recommendation? Is this a bug in the telerik control?

Note - I have also tried clearing the selectedDate of radDate2 before setting its max_date, just to check if it has something to do with the error. But in vain.

0
Radoslav
Telerik team
answered on 29 Jul 2013, 09:47 AM
Hello Ashwini,

I verified that the described issue exists into the current version of our controls. However our developers fixed it and the fix will be available into the next internal build. On the following link you could find instructions how to use the hotfix dlls:
http://www.telerik.com/help/aspnet-ajax/introduction-using-hotfix.html

Please excuse us for the temporary inconvenience.

Regards,
Radoslav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Ashwini
Top achievements
Rank 1
answered on 29 Jul 2013, 11:10 AM
Thank you.
Tags
Calendar
Asked by
R
Top achievements
Rank 1
Answers by
R
Top achievements
Rank 1
Tsvetoslav
Telerik team
Rob T
Top achievements
Rank 1
Sachidananda
Top achievements
Rank 1
Radoslav
Telerik team
Ashwini
Top achievements
Rank 1
Share this question
or