Add support for dateStyle and timeStyle on toLocale*String functions
vincentjames501 opened this issue · 0 comments
vincentjames501 commented
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",
.