Kendo-angular: [DateInput/Picker]: Do not switch to next segment when just automatically switched to current segment and first typed char is separator

Created on 11 Jan 2018  路  6Comments  路  Source: telerik/kendo-angular

I'm submitting a...

  • Suggestion for improvement

Current behavior

Take e.g. the format M/d/yyyy.
When typing "6/", the caret switches to the year part, because after typing "6", the caret was automatically moved to the day part.

Expected behavior

Typing "6/7/2017" and "672017" should both result in the date 6/7/2017.
Typing "1/2/2017" and "01022017" should both result in the date 1/2/2017.
This can be achieved by ignoring typing of the very first separator character after we moved automatically to a next segment.

Minimal reproduction of the problem with instructions

Goto https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/
clear the field
type above mentioned samples. Typing "6/7/2017" will result in "6/day/2017"

What is the motivation or use case for changing the behavior?

Correct use for people used to type separators and for those not typing separators

Enhancement Team1 date-inputs

Most helpful comment

Thanks for the clarification. I missed the '/' typing part :).

Indeed, the dateinput will switch to the next segment when irrelevant to the segment value is typed.

Will re-open the thread, as the desired behavior is not implemented.

All 6 comments

This seems to be addressed in the latest release of @progress/kendo-angular-dateinputs.

Will close the thread as resolved. Please comment if I am missing something.

In https://www.telerik.com/kendo-angular-ui/components/dateinputs/datepicker/ I still see the wrong behavior. Or is the site not yet updated with the latest versions?

I've prepared a standalone example to be sure that we are reviewing the latest version of the DateInputs.

https://stackblitz.com/edit/angular-aqssja

My tests show that the component works now. Could you check it and let me know if I am missing something?

Seems we are testing different things :-).
When I type a '6' and then a '/', the year is focused.
When '6' is typed the day is focused automatically because there can not follow a valid other digit, that is ok.
But when the user now types a '/' (because he is used to type in dates including separators), it moves to year. But I want that, when the focused was moved automatically to a next part, and the very first character typed is a dateseparator, it should be ignored.

After some further testing I see now perhaps the confusing. When the control has currently a valid date and it is fully selected, then it works as expected.
But when the control is empty (has no date) or only the first is selected, and then you start typing, you will see the behavor I described.

Hope you can reproduce now what I mean.

Thanks for the clarification. I missed the '/' typing part :).

Indeed, the dateinput will switch to the next segment when irrelevant to the segment value is typed.

Will re-open the thread, as the desired behavior is not implemented.

1) First, I'd like to up-vote this as the way it currently works is really annoying and feels unpredictable. A user attempting to do repetitive data entry would--I believe--get very annoyed with the unpredictable behavior associated with the "/" character. If the user types a "/" character it should always result in identical behavior, regardless of whether the user enters a "1" or a "6" for the month or day.

2) I also have one more feature suggestion. In the old Silverlight version of this control, if the user only provided day and month (i.e. "11/15"), the control would auto-populate the year to the current year (i.e. 11/15/2020). In addition, if the user would just enter a 2-character year (i.e. "11/15/20"), the old Silverlight control was smart enough to turn this into a 4-digit year (i.e. 11/15/2020). This was very a nice feature as most entered dates ARE for the current year.

Note that (2) above is much less important than (1), but if you are changing this code anyway...

Was this page helpful?
0 / 5 - 0 ratings