You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to create date text field with validation of max numbers of dates for leap years and months.
First of all I allow input maximum 31 day (or input 04 if start input with 4). if month is valid, i check maximum day count for current month. Then i check if year is leap and if month is february.
Realization sometimes is dirty, but i understand that correct caret position based on replace function.
Wrong caret position when i start typing 5, or paste 29.02.2017.
I've tried to create date text field with validation of max numbers of dates for leap years and months.
First of all I allow input maximum 31 day (or input
04
if start input with4
). if month is valid, i check maximum day count for current month. Then i check if year is leap and if month is february.Realization sometimes is dirty, but i understand that correct caret position based on replace function.
Wrong caret position when i start typing
5
, or paste29.02.2017
.Sandbox sample:
https://codesandbox.io/s/hidden-dream-3bicv
Please, can someone explain my mistake (misconception) or this is really unexpected behaviour?
The text was updated successfully, but these errors were encountered: