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

toLocaleDateString not supporting non-english locales #1439

Open
ilapavuluri opened this issue Jan 16, 2024 · 0 comments
Open

toLocaleDateString not supporting non-english locales #1439

ilapavuluri opened this issue Jan 16, 2024 · 0 comments

Comments

@ilapavuluri
Copy link

I am using rhino 1.7.14 (latest version) in my java application as JS engine

The below code is returing: 'January 15, 2024' (is the value of create_date_de2)

options = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
};

create_date_de2 = (new Date()).toLocaleDateString('de-DE',options);

In online javascript, if I run:
const options = { year: 'numeric', month: 'long', day: 'numeric' };
console.log((new Date()).toLocaleDateString('de-DE',options))

it is working fine by providing: 15. Januar 2024

Why rhino is not supporting locale? am I missing anything here? do I need to do any configuration ? Mine is windows machine German language pack also installed.

Appriciate any help on this.

Thanks
Ashok.

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