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
00:00:00 should not be equal to 12:00:00 when parsed with h:m:s format #123
Comments
You should be using However, there does seem to be a bug. 0 o'clock is not a valid hour in a 12-hour clock. I'm not sure what the desired behavior is in this situation though. It doesn't seem like you should get an error if it is 0 o'clock. |
Cool, thanks for the reply. I switched over to using HH but seem to still be getting the issue, at least with Chrome: moment('12:00:00', 'HH:mm:ss').format('HH:mm:ss'); // "00:00:00" (incorrect?) |
By default, The original post was be having correctly. You can see this if you add
I believe the issue below is a known issue that was fixed. It was caused by the commit in #74 and fixed in #92. I'm adding unit tests for it though. I'll also clarify the docs.
If you are using 1.2.0, you should upgrade to 1.3.0, as that was when the bugfix was introduced. |
Cool, sounds good. Thanks! |
Fix copy/paste method sig issue
These seem to be the wrong results - am I doing something wrong?
moment('12:00:00', 'hh:mm:ss').format('hh:mm:ss'); // "12:00:00"
moment('00:00:00', 'hh:mm:ss').format('hh:mm:ss'); // "12:00:00" (seems to be incorrect)
moment('12:30:00', 'hh:mm:ss').format('hh:mm:ss'); // "12:30:00"
moment('00:30:00', 'hh:mm:ss').format('hh:mm:ss'); // "12:30:00" (seems to be incorrect)
The text was updated successfully, but these errors were encountered: