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

Add support for dateStyle and timeStyle on toLocale*String functions #161

Open
vincentjames501 opened this issue Jan 14, 2022 · 0 comments

Comments

@vincentjames501
Copy link

Issue Description

Date.toLocaleDateString(), Date.toLocaleTimeString, and Date.toLocaleString do not support dateStyle and timeStyle options (and likewise with Intl.DateTimeFormat.format). The options are ignored on Android.

This is what I'd expect when comparing to the browser and iOS.

new Date().toLocaleDateString([], {dateStyle: 'short'})
'1/14/22'
new Date().toLocaleDateString([], {dateStyle: 'medium'})
'Jan 14, 2022'
new Date().toLocaleDateString([], {dateStyle: 'long'})
'January 14, 2022'
new Date().toLocaleDateString([], {dateStyle: 'full'})
'Friday, January 14, 2022'
new Date().toLocaleTimeString([], {timeStyle: 'short'})
'12:16 PM'
new Date().toLocaleTimeString([], {timeStyle: 'medium'})
'12:16:57 PM'
new Date().toLocaleTimeString([], {timeStyle: 'long'})
'12:17:06 PM PST'
new Date().toLocaleTimeString([], {timeStyle: 'full'})
'12:17:15 PM Pacific Standard Time'

Version, config, any additional info

We're using "jsc-android": "250230.2.1",.

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