1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:07:45 +00:00

LibJS: Set both {minimum, maximum}FractionDigits in Intl.DurationFormat

This is a normative change in the Intl.DurationFormat spec.

See: b293603e
This commit is contained in:
Idan Horowitz 2022-07-02 15:58:34 +03:00
parent fb8c4a724e
commit 1ebc5af2f0
3 changed files with 8 additions and 5 deletions

View file

@ -38,7 +38,7 @@ describe("correct behavior", () => {
new Intl.DurationFormat("en", {
style: "narrow",
nanoseconds: "numeric",
fractionalDigits: 7,
fractionalDigits: 3,
}).format(duration)
).toBe("1y, 2m, 3w, 3d, 4h, 5m, 6s, 7ms, and 8.009μs");
@ -58,7 +58,7 @@ describe("correct behavior", () => {
new Intl.DurationFormat("de", {
style: "narrow",
nanoseconds: "numeric",
fractionalDigits: 7,
fractionalDigits: 3,
}).format(duration)
).toBe("1 J, 2 M, 3 W, 3 T, 4 Std., 5 Min., 6 Sek., 7 ms und 8,009 μs");
});

View file

@ -138,7 +138,7 @@ describe("correct behavior", () => {
new Intl.DurationFormat("en", {
style: "narrow",
nanoseconds: "numeric",
fractionalDigits: 7,
fractionalDigits: 3,
}).formatToParts(duration)
).toEqual([
{ type: "element", value: "1y" },
@ -240,7 +240,7 @@ describe("correct behavior", () => {
new Intl.DurationFormat("de", {
style: "narrow",
nanoseconds: "numeric",
fractionalDigits: 7,
fractionalDigits: 3,
}).formatToParts(duration)
).toEqual([
{ type: "element", value: "1 J" },