2

I have to explain the way react-date-picker auto-correct the date when enter raw string into input.

For example, I tried on the demo site of react-date-picker. (https://reactdatepicker.com/)

I typed 2019ab12 after blur by tab, I got the result 01/01/2019

I typed 222 after blur by tab, I got the result 02/01/2019

I typed 4444 after blur by tab, I got the result 01/01/444

I can figure out the logic in some cases I've tried, but it is insufficient to confirm about the logic because my customers tried many cases and ask the question, What kind of logic that we applied to turn the invalid date to the valid one

My question is, does it (auto-correct behavior) follow any standard or it is just the implementation of this specific library.

Dharman
  • 30,962
  • 25
  • 85
  • 135
thelonglqd
  • 1,805
  • 16
  • 28

1 Answers1

0

For those who have same questions as mine, please read the moment docs, parsing section to know the logic.

URL: https://momentjs.com/guides/#/parsing/.

thelonglqd
  • 1,805
  • 16
  • 28