Last Updated:
17 Nov 2021 13:11
by ADMIN
DateTimePicker Min / Max validation after loosing control as a standard scenario.
We have two questions about DateTimePicker logic related to Min and Max values:
1) Validation of handwritten value after loosing focus.
When there are restrictions for min / max values of component, user can't picks invalid date with dropdown and validation works perfectly. However when user enters value as a string, telerik component lets him do that without any alerts. After loosing focus component sets date that match to chosen interval. The problem arrives when user clicks "Save button" after handwritten invalid date and Telerik corrects it by itself with valid but not always correct date from user side. Is it normal situation or there might be a solution to prevent possibility of entering of invalid date before loosing control?
2) Result date after handwritten input that out of accessible range.
After input of out of range date Telerik compute valid date and set it in component. May be situation when user entered correct value for the first time and then tried to change it to invalid, then he would lose his first entered date. Maybe should save last valid date for the next attempts of inputs or leave component logic in current condition?
There is example of situation:
1. TelerikDateTimePicker.Max = 11/1/2021 6:12 PM;
2. User picks date 11/1/2021 6:07 PM;
3. User decides to set 11/1/2021 6:35 PM and writes it in text field;
4. Telerik corrects its date to 11/1/2021 6:03 PM because it's valid, but previous user date was lost.