Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selecting day on calendar with DayPickerInput and format=Array throws error #491

Closed
alanasim opened this issue Sep 5, 2017 · 2 comments
Closed
Milestone

Comments

@alanasim
Copy link

alanasim commented Sep 5, 2017

Selecting day in overlay calendar while using DayPickerInput with format=Array throws error "Uncaught TypeError: format.match is not a function" from moment.js.

Traced this to moment.js parsing accepting an array of string formats to check against but moment.format() expects a single string as argument [doc]

Example:
https://codesandbox.io/s/5wz092n1pk

Maybe as an easy compromise/fix when format is given as an array default to formatting by the first array element?

@gpbl gpbl added the bug label Sep 23, 2017
@gpbl gpbl added this to the v6.1.1 milestone Sep 23, 2017
@gpbl
Copy link
Owner

gpbl commented Sep 23, 2017

This is indeed a bug! Thanks for reporting it 👍

@gpbl gpbl modified the milestones: v6.1.1, v6.2.0 Sep 27, 2017
gpbl added a commit that referenced this issue Oct 2, 2017
@gpbl gpbl closed this as completed in 228b890 Oct 2, 2017
@gpbl
Copy link
Owner

gpbl commented Oct 5, 2017

Fix published in v6.2.0.

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

No branches or pull requests

2 participants