Skip to content

Commit af3890a

Browse files
ben-allenMs2ger
authored andcommitted
update to reflect numeric minutes handling after tc39/proposal-intl-duration-format#180
1 parent 263ed65 commit af3890a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

test/intl402/DurationFormat/prototype/format/numeric-hour-with-zero-minutes-and-non-zero-seconds.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*---
55
esid: sec-Intl.DurationFormat.prototype.format
66
description: >
7-
The correct separator is used for numeric hours with zero minutes and non-zero seconds.
7+
Minutes with numeric or 2-digit style are included in the output when between displayed hours and seconds, even when the minutes value is zero.
88
locale: [en-US]
99
features: [Intl.DurationFormat]
1010
---*/
@@ -14,28 +14,16 @@ const df = new Intl.DurationFormat("en", {
1414
hours: "numeric",
1515
});
1616

17-
const lf = new Intl.ListFormat("en", {
18-
type: "unit",
19-
style: "short",
20-
});
21-
2217
const duration = {
2318
hours: 1,
24-
25-
// Minutes is omitted from the output when its value is zero.
2619
minutes: 0,
27-
28-
// Either seconds or sub-seconds must be non-zero.
2920
seconds: 3,
3021
};
3122

32-
const expected = lf.format([
33-
new Intl.NumberFormat("en", {minimumIntegerDigits: 1}).format(duration.hours),
34-
new Intl.NumberFormat("en", {minimumIntegerDigits: 2}).format(duration.seconds),
35-
]);
23+
const expected = "1:00:03"
3624

3725
assert.sameValue(
3826
df.format(duration),
3927
expected,
40-
`No time separator is used when minutes is zero`
28+
`Minutes always displayed when between displayed hours and seconds, even if minutes is 0`
4129
);

0 commit comments

Comments
 (0)