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

Builtin Date locale's methods ignore locale argument #572

Open
olegbespalov opened this issue May 24, 2024 · 1 comment
Open

Builtin Date locale's methods ignore locale argument #572

olegbespalov opened this issue May 24, 2024 · 1 comment

Comments

@olegbespalov
Copy link
Contributor

What?

One of the k6's users reported that using the Date().toLocaleDateString() always returns the date in the same format.

Date().toLocaleDateString('en-US') Expect 12/30/2012 : Actual 12/30/2012
Date().toLocaleDateString('en-CA') Expect 2012-12-30 : Actual 12/30/2012
Date().toLocaleDateString('en-GB') Expect 30/12/2012 : Actual 12/30/2012
Date().toLocaleDateString('de-DE') Expect 30.12.2012 : Actual 12/30/2012

It's happening since internally, the only dateLayout_en_GB is used, and we don't take into account any arguments.

Probably, that's not what most users will expect.

Why?

Fixing this will help satisfy users' expectations.

@dop251
Copy link
Owner

dop251 commented Jun 3, 2024

I don't see how it's possible without involving a 3rd party library, any suggestions?

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