I select a start date of say 1 month from today. Then I go into the end date and I am able to select a date earlier than the start date.
Can someone confirm this as a bug or just my misunderstanding of the purpose of that demo?
Also I noticed the date picker doesn't appear to care if I enter bogus date values in the input box like 14/01/2011 which is not valid for MM/DD/YYYY format since 14 is not a valid month.
Thanks for your feedback. I am excited about kendoUI but hesitant that there are a lot of potential bugs remaining.
-Steve
4 Answers, 1 is accepted
The DatePicker UI widget does not prevent posting an incorrect date. The min/max range restricts the calendar and end-user cannot select a date, which is out of range. It is allowed to type an invalid date, but the DatePicker's value will be null. You can observe this behavior on this online demo.
In order to prevent posting an incorrect value you should use client-side validation.
As a side note, there was a bug related with the "today" link in the calendar. In the demo you can select today's date, even it is not allowed. This issue is already addressed and the fix will be available in the next release of KendoUI.
Georgi Krustev
the Telerik team
Looks broken to me.
The Range Selection demo shows how to use the min/max method to connect to DatePickers. Once the user selects date from the first widget, the second does not allow to pick date earlier then the selected one. Please note that widget does not restrict user input - if he/she decides to enter invalid date, the widget will set its value to null. If you need to restrict the input, then use Kendo Validator or other validation framework, which will notify the user that the entered value is not valid/out of range.
Georgi Krustev
Telerik
I have been complaining about this for some time, and the solution I got from Telerik was a cluster. I was having to use a lot of extra code to make it work.
Well I finally got around to investigating custom code attributes, both server side and client side, and discovered that it is quite easy to add a custom code attribute that works on both the client and the server side. You have to create a class that handles both scenarios, and you have to write some custom javascript, but once you get the hang of it, it's really easy.
We have requirements on several of our date values that they are on or before today or on or after today, so I created two attributes:
1) DateTimeMaxNowAttribute
2) DateTimeMinNowAttribute
I will attach the files for all of this. One of the namespaces you will need is the one that supports: ModelClientValidationRule apparently, from what I am reading this used to be in a different namespace, but I you are using MVC 4 or later, this rule exists in the System.Web.WebPages namespace.
use the code in the attached files and simply decorate your property like so:
[DateTimeMaxNow]
[DisplayName("Estoppel Request Date")]
[DisplayFormat(DataFormatString = "{0:d}")]
public DateTime? EstoppelRequestDate { get; set; }