Closed Bug 1742572 Opened 3 years ago Closed 3 years ago

bugbug ui page fails to load

Categories

(Core :: Internationalization, defect)

defect

Tracking

()

RESOLVED INVALID
Tracking Status
thunderbird_esr91 --- unaffected
firefox-esr91 --- unaffected
firefox94 --- unaffected
firefox95 --- unaffected
firefox96 --- affected

People

(Reporter: marco, Unassigned)

References

()

Details

(Keywords: regression)

Initially filed on the bugbug repo at https://github.com/mozilla/bugbug/issues/2639, the bug seems to be a regression in Firefox.

I've used mozregression to narrow it down:
7:30.95 INFO: Last good revision: 511af4b42efc6143819739c499a83d5ba4d5e41a
7:30.95 INFO: First bad revision: a1b606f473a01b035eee56e271d02467b27a458b
7:30.95 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=511af4b42efc6143819739c499a83d5ba4d5e41a&tochange=a1b606f473a01b035eee56e271d02467b27a458b

Standalone test case:

function GetFormatterParts(timeZone, epochMilliseconds){
  const formatter = new Intl.DateTimeFormat("en-us", {
    timeZone,
    hour12: false,
    era: "short",
    year: "numeric",
    month: "numeric",
    day: "numeric",
    hour: "numeric",
    minute: "numeric",
    second: "numeric"
  });
  const datetime = formatter.format(new Date(epochMilliseconds));
  const [date, fullYear, time] = datetime.split(/,\s+/);
  const [month, day] = date.split(" ");
  const [year, era] = fullYear.split(" ");
  const [hour, minute, second] = time.split(":");
  return {
    year: era === "BC" ? -year + 1 : +year,
    month: +month,
    day: +day,
    hour: hour === "24" ? 0 : +hour,
    minute: +minute,
    second: +second
  };
}

GetFormatterParts("America/Los_Angeles", Date.now());

GetFormatterParts expects that the formatted date-time string can be split into three parts through the regular expression /,\s+/. This worked before the update, because the formatted string looked like "11 23, 2021 AD, 05:00:00". But after the update to ICU 70, which includes an update to CLDR 40, the string now looks like "11/23/2021 A, 05:00:00", i.e. can no longer be separated into three parts when searching for a comma.

The relevant CLDR changes are:

Also see common/main/en.xml:

<dateFormatItem id="GyMd">M/d/y GGGGG</dateFormatItem>

(I don't understand why the pattern changes the era from "abbreviated" to "narrow", though.)

It looks like the buggy code is from https://github.com/js-temporal/temporal-polyfill (GetFormatterParts). This issue should be reported to that project, fixed there, and then "bugbug ui" needs to be updated to use the fixed Temporal polyfill.

Thanks for the investigation André! I've filed https://github.com/js-temporal/temporal-polyfill/issues/92.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.