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

Date is out of range

1 Answer 38 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 11 Feb 2009, 01:06 AM
I am using telerik controls in version  2008.2.723.35

I got 2 date picker, what i want to do is set second datepicker's max date according by the first datepicker's selected date

On first datepicker's OnDateSelected event  i set the max date for second data picker.

I can see max date has been set but if the first datepicker's got max or min date setting, when click the second datepicker the "date is out of range" alert shows up, this is not always happen seems like if first datepicker selected date in current month the alert won't shows up.


function OnDateSelected(sender, e) {
        var livesince = $find('<%= addCurrent.FindControl("radcalLivedSince").ClientID %>');
        var today = new Date();
        var validdate = new Date(today.getFullYear() - 2, today.getMonth(), today.getDate());
        var livesince_current = livesince.get_selectedDate();
        if (livesince_current >= validdate) {
            //set max date for date picker in pre address
            var prelivesince = $find('<%= addPrevious.FindControl("radcalLivedSince").ClientID %>');
            var preadd_maxdate = new Date(livesince_current.getFullYear(), livesince_current.getMonth(), livesince_current.getDate() - 1);
            prelivesince.set_maxDate(preadd_maxdate);
       }
}


Is this a bug?

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Feb 2009, 10:24 AM
Hi John,

In my attempt to reproduce this abnormality I have created a test project. I could not replicate this error.
I used our latest official build of RadControls in my test web site.
For your convenience I have attached it to this forum thread. Please examine it and tell me if I am missing something.
If the error still persists I will suggest you to open a regular support ticket on this matter and send us a test project reproducing this erratic behavior.

Regards,
Georgi Krustev
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.
Tags
Calendar
Asked by
John
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or