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

Added the nonMilitaryTime format support with a new format #243

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mbellet
Copy link
Contributor

@mbellet mbellet commented May 16, 2019

Added the nonMilitaryTime format support with this new format:
H e HH --> 24 Hours
h e hh --> 12 hours
tt --> AM e PM

new nonMilitaryTime format example: M/d/yyyy h:mm tt
old format example: dd/MM/yyyy HH:mm

H e HH --> 24 Hours
h e hh --> 12 hours
tt --> AM e PM

new nonMilitaryTime format example: M/d/yyyy h:mm tt
old format example: dd/MM/yyyy HH:mm
@@ -1359,17 +1367,20 @@
return '';
}
var val = {
h: date.getUTCHours(),
H: date.getUTCHours(),
h: date.getUTCHours() % 12,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbellet You will want to check date.getUTCHours == 0 this indicates 12:00 AM. right now when you select 12:00 am it displays as 00:00 AM.

Possible solution is:
h: (date.getUTCHours() == 0) ? 12 : date.getUTCHours() % 12

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

Successfully merging this pull request may close these issues.

2 participants