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

defaultHour doesn't respect dateFormat when using a time picker #939

Closed
Dylan-Chapman opened this issue Jul 12, 2017 · 3 comments
Closed

Comments

@Dylan-Chapman
Copy link

Details

When using dateFormat in combination with defaultHour, the initial display may be incorrect.

I set a 12-hour time format (i.e. 3:00 PM). I then set the defaultHour to 15. This displays 15:00 PM in the time picker by default. If you use the arrows to increment the hours, the problem is corrected (i.e. pressing the up arrow takes you from 15 to 4). Ideally, it would display 3:00 PM in the time picker in the first place.

Reproduction Link

https://jsfiddle.net/aj6k3f1v/51/

Your Environment

  • flatpickr version used: v3.0.6
  • Browser name and version: Google Chrome 59.0.3071.115 (Official Build) (64-bit)
  • OS and version: Windows 10
@Dylan-Chapman
Copy link
Author

Looking over the config options, this may be more of a conflict with ignoring the "time_24hr" option, since the default is false?

@chmln chmln closed this as completed in b532e89 Jul 16, 2017
@Dylan-Chapman
Copy link
Author

The fix almost works. It seems that it's messed up if defaultHour is either 12 or 24 now. Both of those set the default time to 00:00 PM, instead of 12:00 PM and 12:00 AM. Would you prefer a new issue be opened for this?

@chmln chmln reopened this Jul 18, 2017
@chmln chmln closed this as completed in bb1c0c4 Aug 13, 2017
@mattcphillips
Copy link

I am still seeing the parsing issue mentioned above with version 3.0.7 of flatpickr which I thought was supposed to include the fix. If either 12 or 24 is passed in for the default hour then I get a default time of 00:00 PM, instead of 12:00 PM and 12:00 AM.

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

3 participants