Timothy Flynn
82e730eba1
LibJS: Change default time display options to "always" for digital style
...
This is a normative change in the Intl.DurationFormat proposal. See:
d28076b
2022-09-22 14:39:24 +01:00
Timothy Flynn
60a6bae53d
LibJS: Change digital default style from "narrow" to "short"
...
This is a normative change in the Intl.DurationFormat proposal. See:
4c24876
2022-09-21 16:09:38 +01:00
Timothy Flynn
887dac0929
LibJS: Handle NumberFormat's [[UseGrouping]] option for "true" / "false"
...
This is a normative change to the Intl NumberFormat V3 spec. See:
4751da5
2022-09-18 09:45:40 -04:00
Brian Gianforcaro
d0a1775369
Everywhere: Fix a variety of typos
...
Spelling fixes found by `codespell`.
2022-09-14 04:46:49 +00:00
Timothy Flynn
c477425b9b
LibJS: Create DurationFormat's ListFormat object with type and style
...
This is a normative change in the Intl.DurationFormat spec. See:
1304e4b
2022-08-30 14:26:11 -04:00
Timothy Flynn
127b28c940
LibJS: Use numeric style if the previous style was numeric or 2-digit
...
This is a normative change in the Intl.DurationFormat proposal. See:
3a46ee3
2022-08-30 14:26:11 -04:00
Timothy Flynn
d57b92da09
LibJS: Default to "short" for DurationFormat's style option
...
This is a normative change in the Intl.DurationFormat proposal. See:
b289494
2022-08-30 14:26:11 -04:00
Timothy Flynn
765d016670
LibJS: Default to 0 for DurationFormat's fractionalDigits option
...
This is a normative change in the Intl.DurationFormat proposal. See:
ac7e184
2022-08-30 14:26:11 -04:00
Timothy Flynn
417a385db1
LibJS: Allow out-of-order plural ranges to be formatted
...
This is a normative change to the Intl NumberFormat V3 spec:
0c3d849
2022-07-26 10:46:08 -07:00
Timothy Flynn
fd7d97fba5
LibJS: Allow out-of-order number ranges to be formatted
...
This is a normative change to the Intl NumberFormat V3 spec:
0c3d849
2022-07-26 10:46:08 -07:00
Timothy Flynn
415742ab98
LibJS: Allow out-of-order date ranges to be formatted
...
This is a normative change to the Intl spec:
769df4b
2022-07-26 10:46:08 -07:00
Timothy Flynn
ae2acc8cdf
LibJS+LibUnicode: Generate a set of default DateTimeFormat patterns
...
This isn't called out in TR-35, but before ICU even looks at CLDR data,
it adds a hard-coded set of default patterns to each locale's calendar.
It has done this since 2006 when its DateTimeFormat feature was first
created. Several test262 tests depend on this, which under ECMA-402,
falls into "implementation defined" behavior. For compatibility, we
can do the same in LibUnicode.
2022-07-22 23:51:56 +01:00
Timothy Flynn
b8d4f8debf
LibJS: Selectively display DateTimeFormat day periods as noon
2022-07-21 20:36:03 +01:00
Timothy Flynn
0f26ab89ae
LibJS+LibUnicode: Handle flexible day periods on both sides of midnight
...
Commit ec7d535
only partially handled the case of flexible day periods
rolling over midnight, in that it only worked for hours after midnight.
For example, the en locale defines a day period range of [21:00, 06:00).
The previous method of adding 24 hours to the given hour would change
e.g. 23:00 to 47:00, which isn't valid.
2022-07-21 20:36:03 +01:00
Timothy Flynn
e9e187d15c
LibJS: Implement Intl.NumberFormat.prototype.formatRangeToParts
2022-07-20 22:30:16 +01:00
Timothy Flynn
b4a772cde2
LibJS: Implement Intl.NumberFormat.prototype.formatRange
2022-07-20 22:30:16 +01:00
Timothy Flynn
4b415a23c1
LibJS: Implement Intl.NumberFormat V3's [[RoundingIncrement]] changes
2022-07-18 23:37:31 +01:00
Timothy Flynn
8ee485c350
LibJS: Implement Intl.NumberFormat V3's [[RoundingMode]] changes
2022-07-18 23:37:31 +01:00
Timothy Flynn
37ab7cc694
LibJS: Implement Intl.NumberFormat V3's [[TrailingZeroDisplay]] changes
2022-07-18 08:51:07 +01:00
Timothy Flynn
bb9a44cd50
LibJS: Implement Intl.NumberFormat V3's [[RoundingPriority]] changes
2022-07-18 08:51:07 +01:00
Timothy Flynn
9e50f25ac4
LibJS: Prevent i64 overflow when computing large NumberFormat exponents
...
The largest exponents we compute are on the order of 10^21 (governed by
the maximumSignificantDigits option, which has a max value of 21). That
is too large to fit into the i64 we were using when multiplying this
exponent by the value to be formatted.
Instead, split up the logic to multiply that value by this exponent
based on the value's underlying type:
Number: Do not cast the result of pow() to an i64, and perform the
follow-up multiplication with doubles.
BigInt: Do not use pow(). Instead, compute the exponent as a BigInt
from the start, then perform the follow-up multiplication with that
BigInt.
2022-07-18 08:51:07 +01:00
Timothy Flynn
aafcdc4c72
LibJS: Allow specifying keyword values not directly defined for a locale
...
For example, consider the locales "en-u-nu-fullwide" or "en-u-nu-arab".
The CLDR only declares the "latn" numbering system for the "en" locale,
thus ResolveLocale would change the locale to "en-u-nu-latn". This patch
allows using non-latn numbering systems digits.
2022-07-15 12:31:43 +02:00
Timothy Flynn
cff2d631da
LibJS: Implement Intl.NumberFormat V3's [[SignDisplay]] changes
...
Intl.NumberFormat V3 adds a "negative" option for [[SignDisplay]] to
only use the locale's signed pattern for negative numbers.
2022-07-13 19:22:26 +01:00
Timothy Flynn
733192089f
LibJS: Implement Intl.NumberFormat V3's [[UseGrouping]] changes
...
In the main spec, [[UseGrouping]] can be true or false. In V3, it may be
one of:
auto: Respect the per-locale preference for grouping.
always: Ignore per-locale preference for grouping and always insert
the grouping separator (note: true is now an alias for always).
min2: Ignore per-locale preference for grouping and only insert the
grouping separator if the primary group has at least 2 digits.
false: Ignore per-locale preference for grouping and never insert
the grouping separator.
2022-07-13 19:22:26 +01:00
Timothy Flynn
cd4ee46b70
LibJS: Populate roundingPriority in Intl.PluralRules.resolvedOptions
...
This is inherited from Intl.NumberFormat.
2022-07-13 19:22:26 +01:00
Timothy Flynn
33698b9615
LibJS+js: Parse new constructor options from Intl.NumberFormat V3
...
This contains minimal changes to parse newly added and modified options
from the Intl.NumberFormat V3 proposal, while maintaining main spec
behavior in Intl.NumberFormat.prototype.format. The parsed options are
reflected only in Intl.NumberFormat.prototype.resolvedOptions and the js
REPL.
2022-07-13 19:22:26 +01:00
Timothy Flynn
f089c11b5b
LibJS: Implement Intl.PluralRules.prototype.selectRange
2022-07-12 00:43:34 +01:00
Timothy Flynn
bf85bf2a9e
LibJS: Use Intl.PluralRules within Intl.RelativeFormat
...
The Polish test cases added here cover previous failures from test262,
due to the way that 0 is specified to be "many" in Polish.
2022-07-08 11:51:54 +02:00
Timothy Flynn
36abcd820d
LibJS: Implement Intl.PluralRules.prototype.select
2022-07-08 11:51:54 +02:00
Timothy Flynn
f11cb7c075
LibJS: Populate pluralCategories in Intl.PluralRules.resolvedOptions
2022-07-08 11:51:54 +02:00
Timothy Flynn
b3deec061e
LibJS: Implement Intl.Locale.prototype.weekInfo property
2022-07-06 16:56:42 +02:00
Timothy Flynn
88a560dd84
LibJS: Implement Intl.Locale.prototype.textInfo property
2022-07-06 16:56:42 +02:00
Timothy Flynn
814f13bc2a
LibJS: Implement Intl.Locale.prototype.timeZones property
2022-07-06 16:56:42 +02:00
Timothy Flynn
f6aa6a480c
LibJS: Implement Intl.Locale.prototype.numberingSystems property
2022-07-06 16:56:42 +02:00
Timothy Flynn
ee2be5895f
LibJS: Implement Intl.Locale.prototype.hourCycles property
2022-07-06 16:56:42 +02:00
Timothy Flynn
4d32f38a76
LibJS: Partially implement Intl.Locale.prototype.collations property
...
We do not yet parse collation data from the CLDR. This stubs out the
collations property, analogous to Intl.supportedValuesOf.
2022-07-06 16:56:42 +02:00
Timothy Flynn
e9bc35d805
LibJS: Implement Intl.Locale.prototype.calendars property
2022-07-06 16:56:42 +02:00
Idan Horowitz
1ebc5af2f0
LibJS: Set both {minimum, maximum}FractionDigits in Intl.DurationFormat
...
This is a normative change in the Intl.DurationFormat spec.
See: b293603e
2022-07-02 18:32:35 +03:00
Idan Horowitz
fb8c4a724e
LibJS: Disallow mixed-sign durations in Intl.DurationFormat
...
This is a normative change in the Intl.DurationFormat spec.
See: 89ab1855
2022-07-02 18:32:35 +03:00
Idan Horowitz
b6b8356c0c
LibJS: Implement Intl.DurationFormat.prototype.formatToParts
2022-07-01 01:00:05 +03:00
Idan Horowitz
706ff5ac83
LibJS: Implement Intl.DurationFormat.prototype.format
2022-07-01 01:00:05 +03:00
Idan Horowitz
d9a4b3e46a
LibJS: Implement Intl.DurationFormat.prototype.resolvedOptions
2022-07-01 01:00:05 +03:00
Idan Horowitz
b20ef7d640
LibJS: Implement Intl.DurationFormat.supportedLocalesOf
2022-07-01 01:00:05 +03:00
Idan Horowitz
97fe37bcc2
LibJS: Start implementing the stage 3 Intl.DurationFormat proposal
2022-07-01 01:00:05 +03:00
Timothy Flynn
f8e7701cf3
LibJS: Disallow calendar display names which contain an underscore
...
This is a normative change in the Intl spec. See:
2703d06
2022-03-30 14:24:32 +01:00
Timothy Flynn
96459e4b3a
LibJS: Define the Intl.Collator's compare function name to be empty
2022-02-21 16:30:19 +00:00
Idan Horowitz
6558f4ae6b
LibJS: Implement get Intl.Collator.prototype.compare
2022-02-20 22:05:59 -05:00
Idan Horowitz
2cd3d4a287
LibJS: Implement Intl %SegmentIteratorPrototype%.next ( )
2022-01-31 21:05:04 +02:00
Idan Horowitz
366468f1de
LibJS: Implement Intl %SegmentsPrototype%.containing
2022-01-31 21:05:04 +02:00
Timothy Flynn
fb08a5a896
LibJS: Implement Intl.supportedValuesOf
...
This is a stage 3 ECMA-402 proposal:
https://tc39.es/proposal-intl-enumeration/
2022-01-31 00:32:41 +00:00