Skip to content

Added the nonMilitaryTime format support with a new format - #243

Open
mbellet wants to merge 2 commits into
najlepsiwebdesigner:masterfrom
mbellet:master
Open

Added the nonMilitaryTime format support with a new format#243
mbellet wants to merge 2 commits into
najlepsiwebdesigner:masterfrom
mbellet:master

Conversation

@mbellet

@mbellet mbellet commented May 16, 2019

Copy link
Copy Markdown
Contributor

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

mbellet added 2 commits May 16, 2019 12:09
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
var val = {
h: date.getUTCHours(),
H: date.getUTCHours(),
h: date.getUTCHours() % 12,

Copy link
Copy Markdown

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