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

raddatepicker max date

3 Answers 305 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
cognos s
Top achievements
Rank 1
cognos s asked on 25 Nov 2009, 04:16 PM
I am setting raddatepicker like this:
raddatepicker.maxdate = datetime.today...but still its allowing me to select future dates in the popup calendar.

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 25 Nov 2009, 04:35 PM
Hello Cognos,

I'm unable to reproduce the problem. Please try the following code-snippets and let me know what your findings are.
protected void Page_Load(object sender, EventArgs e)
{
    RadDatePicker1.MaxDate = DateTime.Now;
}

<telerik:RadDatePicker ID="RadDatePicker1" runat="server" />

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David
Top achievements
Rank 1
answered on 11 Aug 2015, 06:14 PM

Hello Daniel,

i try whit ur code-snippets and it works on local mode, but when i try it on other server (with UTC time) leave me to select future date and hours, how i can solve it?

thanks!

0
David
Top achievements
Rank 1
answered on 11 Aug 2015, 06:43 PM

i have the solution, sorry :)

i just do this: 

window.onload = function() {
   getDate();
}
 
 
function getDate() {
  var now = new Date();
  var datePicker = window.$find("<%=RadDateTimePicker.ClientID%>");
  datePickerInicio.set_maxDate(new Date(now.getFullYear(), now.getMonth(), now.getDate(),   
  now.getHours()));
}

this solve my problem :D

Tags
Calendar
Asked by
cognos s
Top achievements
Rank 1
Answers by
Daniel
Telerik team
David
Top achievements
Rank 1
Share this question
or