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
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:  These generic expressions make it much easier to set restrictions.
1 comment
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:


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

	min: new Date(),
	max: new Date(today.setMonth(today.getMonth() + 6))


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.