You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
CLDR and ICU provide as part of the RelativeDateTimeFormatter API an option to format time together with the date to produce strings like tomorrow at 3 pm or today at 3:45 pm.
Since we pass Date object as parameter already, all we really have to do is enable formatting of that.
My suggestion is to add hour, minute, second and hourCycle as options for RelativeTimeFormat.
Example:
letrtf=newIntl.DateTimeFormat('en-US',{hour: 'numeric'});rtf.format(newDate()+1000*60*60*24);// 'tomorrow at 3 pm'
letrtf=newIntl.DateTimeFormat('en-US',{hour: 'numeric',minute: 'numeric'});rtf.format(newDate()+1000*60*60*24);// 'tomorrow at 3:45 pm'
by default those options would be undefined and no date+time formatting would happen.
I suggest that we keep this idea for second revision of the API, but wanted to propose it already to put it in scope of any API conversations.
The text was updated successfully, but these errors were encountered:
Alternatively, we could land this API on DateTimeFormat because one other form that it could be use with is Monday at 2pm or Monday, January 3rd at 3:45pm.
So it's less about relative, and more about human readable form of combining date and time where date can be absolute (Monday, January 4th) or relative (Tomorrow).
The en-US pattern for this in CLDR 30 looks like this: http://www.unicode.org/cldr/charts/30/summary/en.html#1825
it's less about relative, and more about human readable form of combining date and time where date can be absolute (Monday, January 4th) or relative (Tomorrow).
CLDR and ICU provide as part of the
RelativeDateTimeFormatter
API an option to format time together with the date to produce strings liketomorrow at 3 pm
ortoday at 3:45 pm
.Since we pass
Date
object as parameter already, all we really have to do is enable formatting of that.My suggestion is to add
hour
,minute
,second
andhourCycle
as options forRelativeTimeFormat
.Example:
by default those options would be undefined and no date+time formatting would happen.
I suggest that we keep this idea for second revision of the API, but wanted to propose it already to put it in scope of any API conversations.
The text was updated successfully, but these errors were encountered: