Queries related to Date Picker

1 Answer 79 Views
DateInput DatePicker
GAURAV
Top achievements
Rank 1
GAURAV asked on 27 May 2021, 06:12 AM

I am using Kendo React version:4.5.0 for Date Picker. For the DatePicker I am using format="MM/dd/yyyy" and formatPlaceholder={{ year : 'YYYY', month : 'MM', day : 'DD' }}.

For this I have two queries:

1. How to have the focus to change automatically from MM to DD to YYYY when the user is typing in the date? Right now we have to use left and right arrow keys to move.

2. Right now the when the user type in the date for example in the YYYY the year is being input from right to left. So, how to have that implemented from left to right ?

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 27 May 2021, 01:42 PM

Hello, Gaurav,

Regarding both questions:

1. How to have the focus to change automatically from MM to DD to YYYY when the user is typing in the date? Right now we have to use left and right arrow keys to move. - I can suggest checking this discussion on the reasons behind the current behavior:

https://github.com/telerik/kendo-react/issues/135

2. Right now the when the user type in the date for example in the YYYY the year is being input from right to left. So, how to have that implemented from left to right? - Currently, the DatePicker and all date inputs only support right to left.  Still, the ensure that I got the requirement right, for example, if the user type 1 2 3 4, the result should be 4321, is that correct?

Regards,
Stefan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

GAURAV
Top achievements
Rank 1
commented on 27 May 2021, 04:36 PM

Thanks Stefan for the response, I'll check for the first query but for the second query what I want to explain is that when a user types in the year in MM/DD/YYYY like
when the user enters 2: it shows 0002 (it should be 2000)
now when the user enters 202: it comes as 0202 (should be 202)
so by right to left I mean the direction of digits being displayed for YYYY.
Stefan
Telerik team
commented on 28 May 2021, 09:18 AM

I saw that you have submitted a separate ticket about this and my colleagues provided an answer for it. I will share it here for visibility:

``

The right-to-left input is a result of the `year` part of the format. Since we're exclusively providing `yyyy` the DateInput expects exactly 4 digits and right-to-left input is necessary to inform the user for that requirement.

Please find the following stackblitz example, where i have changed the format from `MM/dd/yyyy` to `MM/dd/y`, which enables left-to-right input:

https://stackblitz.com/edit/react-cq1cdm?file=app/main.jsx

If additional information is needed, please follow up in the ticket or here.
GAURAV
Top achievements
Rank 1
commented on 28 May 2021, 10:24 AM

Ok Thanks Stefan
Tags
DateInput DatePicker
Asked by
GAURAV
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or