Use a proper Temporal polyfill

This commit is contained in:
Marco Castelluccio 2021-11-23 13:01:21 +01:00
Родитель 13a43cd975
Коммит f1d4542d92
4 изменённых файлов: 5026 добавлений и 71 удалений

5075
ui/changes/package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -16,8 +16,8 @@
"snowpack": "^3.8.8"
},
"dependencies": {
"@js-temporal/polyfill": "^0.2.0",
"apexcharts": "^3.30.0",
"localforage": "^1.10.0",
"proposal-temporal": "^0.8.0"
"localforage": "^1.10.0"
}
}

Просмотреть файл

@ -1,5 +1,5 @@
import ApexCharts from "apexcharts";
import { Temporal } from "proposal-temporal/lib/index.mjs";
import { Temporal } from "@js-temporal/polyfill/lib/index.mjs";
import localForage from "localforage";
// let METABUGS_URL =
@ -550,7 +550,7 @@ export async function renderRiskChart(chartEl, bugSummaries) {
);
// Enforce up to 2 months history, earlier patches are in the model's training set.
let twoMonthsAgo = Temporal.now.plainDateISO().subtract({ months: 2 });
let twoMonthsAgo = Temporal.Now.plainDateISO().subtract({ months: 2 });
if (Temporal.PlainDate.compare(twoMonthsAgo, minDate) > 0) {
minDate = twoMonthsAgo;
}
@ -627,7 +627,7 @@ export async function renderRiskList(bugSummaries) {
table.appendChild(thead);
table.appendChild(tbody);
const oneWeekAgo = Temporal.now.plainDateISO().subtract({ weeks: 1 });
const oneWeekAgo = Temporal.Now.plainDateISO().subtract({ weeks: 1 });
const minimumBugSummaries = getMaximumBugSummaries(
bugSummaries.filter(
@ -1168,7 +1168,7 @@ export async function renderFixTimesList(bugSummaries) {
table.appendChild(thead);
table.appendChild(tbody);
const oneWeekAgo = Temporal.now.plainDateISO().subtract({ weeks: 1 });
const oneWeekAgo = Temporal.Now.plainDateISO().subtract({ weeks: 1 });
const minimumBugSummaries = getMaximumBugSummaries(
bugSummaries.filter(
@ -1509,7 +1509,7 @@ export async function renderPatchCoverageList(bugSummaries) {
table.appendChild(thead);
table.appendChild(tbody);
const oneWeekAgo = Temporal.now.plainDateISO().subtract({ weeks: 1 });
const oneWeekAgo = Temporal.Now.plainDateISO().subtract({ weeks: 1 });
const minimumBugSummaries = getMaximumBugSummaries(
bugSummaries.filter(
@ -1627,7 +1627,7 @@ export async function renderReviewTimeList(bugSummaries) {
table.appendChild(thead);
table.appendChild(tbody);
const oneWeekAgo = Temporal.now.plainDateISO().subtract({ weeks: 1 });
const oneWeekAgo = Temporal.Now.plainDateISO().subtract({ weeks: 1 });
const minimumBugSummaries = getMaximumBugSummaries(
bugSummaries.filter(
@ -1742,7 +1742,7 @@ export async function renderTestFailureList() {
const components = getOption("components");
const oneWeekAgo = Temporal.now.plainDateISO().subtract({ weeks: 1 });
const oneWeekAgo = Temporal.Now.plainDateISO().subtract({ weeks: 1 });
const allTestStatsDays = [].concat
.apply(

Просмотреть файл

@ -1,4 +1,4 @@
import { Temporal } from "proposal-temporal/lib/index.mjs";
import { Temporal } from "@js-temporal/polyfill/lib/index.mjs";
import * as common from "./common.js";
let resultGraphs = document.getElementById("result-graphs");
@ -83,7 +83,7 @@ async function renderUI() {
}
(async function init() {
let startDate = Temporal.now.plainDateISO().subtract({ years: 1 }).toString();
let startDate = Temporal.Now.plainDateISO().subtract({ years: 1 }).toString();
document.getElementById("createStartDate").value = document.getElementById(
"fixStartDate"
).value = startDate;