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

AM/PM meridiam broken at 12:00 pm #715

Closed
leahwchang opened this issue Nov 1, 2019 · 2 comments
Closed

AM/PM meridiam broken at 12:00 pm #715

leahwchang opened this issue Nov 1, 2019 · 2 comments

Comments

@leahwchang
Copy link

leahwchang commented Nov 1, 2019

Hello, I'm having trouble getting the correct format to show the correct time stamp.

Time data:
Epoch timestamp: 1488474000
Timestamp in milliseconds: 1488474000000
Date and time (your time zone): Thursday, March 2, 2017 12:00:00 PM GMT-05:00

Problem:
I want to show March 2, 2017 12:00 p.m. and I'm using dayjs 'format("LLL")'
But the results returns March 2, 2017 12:00 a.m.
I also tried using format('MMMM D, YYYY h:mm a') and it's returning the same error.

Any ideas or help is much appreciated.

@iamkun
Copy link
Owner

iamkun commented Nov 4, 2019

You can override it with your own

meridiem: (hour, minute, isLowercase) => {
    // OPTIONAL, AM/PM
    return hour > 12 ? 'PM' : 'AM'
  }

https://github.com/iamkun/dayjs/blob/master/docs/en/I18n.md

@iamkun
Copy link
Owner

iamkun commented Jan 6, 2020

I'll close this issue since it's been a while since it's been opened. Feel free to reopen if you have updates on this

@iamkun iamkun closed this as completed Jan 6, 2020
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