Completed
Last Updated: 13 Mar 2020 09:17 by ADMIN
Brian Mains
Created on: 03 Jan 2016 16:48
Category: Date/Time Pickers
Type: Feature Request
2
DatePicker Accepting Relative Values for min/max
For the datepicker control, it would be great if it could support relative values for the min and max range like the jQuery datepicker does.  For instance, you can set minDate: 0, which is today.  Or you can say maxDate: "+6M" for a max date of 6 months from today (as in their documentation: https://api.jqueryui.com/datepicker/#option-maxDate).  These generic expressions make it much easier to set restrictions.
1 comment
ADMIN
Viktor Tachev
Posted on: 13 Mar 2020 09:17

Hi Brian,

 

The min and max options accept a Date and can be configured as described. Check out the sample below that illustrates the approach:

https://dojo.telerik.com/iqijiXEG

 

<input id="datepicker" />
<script>
  var today = new Date();

  $("#datepicker").kendoDatePicker({
	min: new Date(),
	max: new Date(today.setMonth(today.getMonth() + 6))
  });
</script>

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.