Intent to Ship: Add formatRange / formatRangeToParts to DateTimeFormat

58 views
Skip to first unread message

Frank Tang

unread,
May 9, 2019, 11:22:25 PM5/9/19
to blink-dev, Sathya Gunasekaran, Mathias Bynens, Adam Klein, v8-users, Nebojša Ćirić, Frank Yung-Fong Tang

Intend to ship for Chrome m76


Title: Intent to Ship: Add formatRange / formatRangeToParts to DateTimeFormat


Contact emails

ft...@chromium.com, faba...@chromium.com

Explainer

https://github.com/tc39/proposal-intl-DateTimeFormat-formatRange

https://rawgit.com/fabalbon/proposal-intl-DateTimeFormat-formatRange/master/out/ (notice the spec is already advanced into stage 3 in tc39 March 2019 meeting but the latest version has not bump the version from 2 to 3 yet)


Spec

https://rawgit.com/fabalbon/proposal-intl-DateTimeFormat-formatRange/master/out/

Design Doc https://goo.gl/PGUQ1d 
Why the tag review process is being skipped: JavaScript features do not need to go through a TAG review, as they already get significant scrutiny as part of the TC39 staging process.



Summary

Add two new functions to Intl.DateTimeFormat.prototype - formateRange and formatRangeToParts to formate the range of two dates in a given locale.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/?fromgroups#!searchin/blink-dev/DateTimeFormat%7Csort:date/blink-dev/WTAjjcXaraA/osqw0lCpBAAJ



Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes


Demo link

https://github.com/tc39/proposal-intl-DateTimeFormat-formatRange


Debuggability

Nothing special.



Risks

Interoperability and Compatibility

This is a new API which agreed in TC39 meeting as a Stage 3 proposal. Engineer from Firefox team is supporting this proposal and the development is tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1496584


Ergonomics

The performance of constructing the Intl.DateTimeFormat could be slower if we create the underline icu DateIntervalFormatter. To avoid such performance issue we identified, currently we plan to lazy initialize the required DateIntervalFormatter upon the first call to the formatRange or formateRangeToParts and cache the value afterward. This approach avoid such performance impact.


Activation

Web developers could use the API immediately upon our shipment, based on the usage of previous well supported Intl.DateTimeFormat object.



Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.


Tests under tc39/test262 will includes many tests to test this API.

test/intl402/DateTimeFormat/prototype/formatRange and

test/intl402/DateTimeFormat/prototype/formatRangeToParts


Testing Status (since the feature is currently behind a flag, the breakage, which does not include the flag turning on is high. Once shipped, with the flag turn on by default, the passing rate will turn to 100%) 

Frank Tang

unread,
May 13, 2019, 12:04:14 PM5/13/19
to blink-dev, Sathya Gunasekaran, Mathias Bynens, Adam Klein, blink-api-ow...@chromium.org, v8-users, Nebojša Ćirić, Frank Yung-Fong Tang

TAMURA, Kent

unread,
May 15, 2019, 4:23:01 AM5/15/19
to Frank Tang, blink-dev, Sathya Gunasekaran, Mathias Bynens, Adam Klein, v8-users, Nebojša Ćirić, Frank Yung-Fong Tang
LGTM

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOcELL9mCNtM745fqWcVMwv1_JNZD0t7z%3DzDihbMiziOLHwOUw%40mail.gmail.com.


--
TAMURA Kent
Software Engineer, Google


Daniel Bratell

unread,
May 15, 2019, 3:11:25 PM5/15/19
to blink-dev, Sathya Gunasekaran, Mathias Bynens, Adam Klein, blink-api-ow...@chromium.org, Frank Tang, v8-users, Nebojša Ćirić, Frank Yung-Fong Tang
LGTM2  (after tkent's unnumbered LGTM).

/Daniel
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOcELL8YQJXzJ_g%2BFKskAsFmGjWExziQ0%2Btp1STn%2BQ9zMbabrw%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Yoav Weiss

unread,
May 16, 2019, 8:31:22 AM5/16/19
to Daniel Bratell, blink-dev, Sathya Gunasekaran, Mathias Bynens, Adam Klein, blink-api-owners-discuss, Frank Tang, v8-users, Nebojša Ćirić, Frank Yung-Fong Tang
LGTM3

You received this message because you are subscribed to the Google Groups "blink-api-owners-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-api-owners-d...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-api-owners-discuss/op.z1uh85ybrbppqq%40cicero2.linkoping.osa.
Reply all
Reply to author
Forward
0 new messages