Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Faulty date format #18

Open
mrneatly opened this issue Nov 20, 2020 · 2 comments
Open

Faulty date format #18

mrneatly opened this issue Nov 20, 2020 · 2 comments

Comments

@mrneatly
Copy link

If I specify date format like YYYY.MM.DD, the datepicker works as expected, but if I switch placeholders and use format DD.MM.YYYY, component crashes with throwing next message in console: RangeError: Invalid array length.

After an additional investigation I discovered that the same message pops up if format starts with anything but year.

@muarachmann
Copy link
Contributor

If I specify date format like YYYY.MM.DD, the datepicker works as expected, but if I switch placeholders and use format DD.MM.YYYY, component crashes with throwing next message in console: RangeError: Invalid array length.

After an additional investigation I discovered that the same message pops up if format starts with anything but year.

Did you use the FormatDate prop? by default it is set to false and has value of YYYY-MM-DD if you insists using DD.MM.YYYY then make sure to specify this in the props.

@mrneatly
Copy link
Author

Sorry, it's been a while since I put this solution into use last time. Can't say for sure, but I can confirm I did it according to the docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants