New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(android): add Intl DateTimeFormat, NumberFormat, and Collator #11698
Conversation
- Implemented as Java proxies instead of #if-ing in V8's "Intl" which would add 20 MB per architecture. - Modified toLocaleString(), toLocaleDateString(), and toLocaleTimeString() methods to support locale/options.
|
- Engineering notation exponent must be in increments of 3. - Modified engineering/scientific notation to respect fraction digit settings. - Added iOS to several Intl.NumberFormat unit tests. - Added egnineering notation unit test.
We should add the Intl APIs to the docs under the Global folder. |
- Modifed compare() method to be bound to instance by default. - Allows compare method to be passed by reference to sort() function and other functions.
- Doing a "new" on lambdas is non-standard and not supported by newest V8 runtime.
- Removed unneeded eslint-disable comments. - Optimized common JS files to use OS_ANDROID blocks. - Added missing JS "new" operators.
- Added formatToParts() unit tests to iOS. - Added Intl constructor checks. - Added Collator language sensitive unit test.
- Modified to match behavior in JavaScriptCore and node.js/V8. * 1st argument must be locales. Cannot be treated as options argument.
- Added locale support to: * String.localeCompare() * String.toLocaleLowerCase() * String.toLocaleUpperCase()
manually rebase/merged to master, 9_1_X, 9_3_X |
JIRA:
Summary:
(iOS already supports the below. Adding to Android for parity.)
Intl.Collator
support.Intl.DateTimeFormat
support.Intl.NumberFormat
support.Date.toLocaleString()
Date.toLocaleDateString()
Date.toLocaleTimeString()
Number.toLocaleString()
String.localeCompare()
String.toLocaleLowerCase()
String.toLocaleUpperCase()
Test:
<Month>/<Day>/<Year>
1,234,567.8
$1,234.56
<Day>.<Month>.<Year>
1.234.567,8
1.234,56 €
<Year>/<Month>/<Day>
1,234,567.8
¥ 1,235
app.js