Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Difference in Date format of dateStyle "medium" with respect to web standards. #4551

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

Open
vishwa-rippling opened this issue Oct 9, 2024 · 1 comment

Comments

@vishwa-rippling
Copy link

Which package?

intl-datetimeformat

Describe the bug

The Date format of dateStyle 'Medium' for en-IN locale is "d MMM y" as per web standards, But it's "dd-MMM-y" in the polyfill provided by intl-datetimeformat.

To Reproduce

Code snippet:

const date = new Date(2024,0,9);

console.log(
  new Intl.DateTimeFormat('en-IN', {
    dateStyle: 'medium',
  }).format(date),
);

Expected behaviour

Current output: 20-Dec-2020
Expected output: 20 Dec 2020

@longlho
Copy link
Member

longlho commented Oct 11, 2024

Our date time format scoring algorithm is different from ICU, thus the result. I personally don't really have to time to effectively port the ICU Java version to JS, so there'll always be slight differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants