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

12:00 am is confused with 12:00 pm in Arabic local. #2711

Open
neuodev opened this issue Aug 18, 2024 · 0 comments
Open

12:00 am is confused with 12:00 pm in Arabic local. #2711

neuodev opened this issue Aug 18, 2024 · 0 comments

Comments

@neuodev
Copy link

neuodev commented Aug 18, 2024

When having the Arabic local enabled, Dayjs has trouble formatting 12:00 pm hours of the day.

import dayjs from 'dayjs' 
import "dayjs/locale/ar";

dayjs.locale("ar");
// The symbol `ص` is for "day hours"
// 12 am is translated to `12 ص`  which is correct and expected. 
dayjs("2024-08-18 12:00 am").format("hh:mm a") // => 12:00 ص
// the `12 pm` is translated to `12 ص` which is not correct and should be translated to `12 م` which is the symbol for "night hours"
dayjs("2024-08-18 12:00 pm").format("hh:mm a") // => 12:00 ص

This will confuse the user about what time of the day it is.

Expected Behavior

12:00 pm should be translated to 12:00 م using the nighttime symbol (here)

Information

  • Day.js Version: ^1.11.12
  • OS: WSL (WINDOW)
  • Browser: Chrome 127.0.6533.120
  • Time zone: GMT+03
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

1 participant