Open zbraniecki opened 7 years ago
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
Thoughts?
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).
:+1:
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.