-
Notifications
You must be signed in to change notification settings - Fork 116
Add IntervalFormat #188
Copy link
Copy link
Closed
Labels
c: datetimeComponent: dates, times, timezonesComponent: dates, times, timezoness: in progressStatus: the issue has an active proposalStatus: the issue has an active proposal
Metadata
Metadata
Assignees
Labels
c: datetimeComponent: dates, times, timezonesComponent: dates, times, timezoness: in progressStatus: the issue has an active proposalStatus: the issue has an active proposal
Type
Fields
Give feedbackNo fields configured for issues without a type.
https://github.com/tc39/ecma402/blob/master/README.md does not have 'Interval format'. So, I guess it's not on the table, yet.
This is a place holder for IntervalFormat. I'll add more details later.
For now, briefly what this API would do is to format an interval with the minimum redundancy given two points in time and a "pattern" (out of a fixed list of patterns).
For instance, given 2016-04-05 and 2016-04-07 and "yMMMd", the formatted result can be "April 5 - 7, 2016". For "MMMd", it'd be 'Apr 5 - 7'.
For 2017-05-12 and 2017-07-04, the result can be "May 12 - July 4" for "MMMd" and "May 12 - Jul 4, 2017" for "yMMMMd"
BTW, CLDR has necessary data and ICU has an implementation.