[webkit-changes] [WebKit/WebKit] fb9e1d: [JSC] `Intl.DurationFormat` should print negative ...

SUZUKI Sosuke noreply at github.com
Sat Dec 28 01:41:44 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fb9e1dc79a670d53bca67aff6e1d19f6922f728f
      https://github.com/WebKit/WebKit/commit/fb9e1dc79a670d53bca67aff6e1d19f6922f728f
  Author: Sosuke Suzuki <aosukeke at gmail.com>
  Date:   2024-12-28 (Sat, 28 Dec 2024)

  Changed paths:
    M Source/JavaScriptCore/runtime/IntlDurationFormat.cpp

  Log Message:
  -----------
  [JSC] `Intl.DurationFormat` should print negative sign for minutes after hidden hours
https://bugs.webkit.org/show_bug.cgi?id=285212

Reviewed by Yusuke Suzuki.

When the `hourDisplay` option is `auto` and `hours` is 0, the hours
value is not printed. So if the following minutes value is negative,
the negative sign should be put before the value.

However, in our current implementation, the negative sign isn't
printed.

```
const df = new Intl.DurationFormat('en-US', { style: "digital", hoursDisplay: "auto" });

print(df.format({ hours: 0, minutes: -2, seconds: -3 }));
// expected: "-02:03"
// actual  : "02:03"
```

* Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:
(JSC::collectElements):

Canonical link: https://commits.webkit.org/288317@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list