moment -> dayjs
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
"@backstage/plugin-sentry": "^0.1.1-alpha.24",
|
||||
"@backstage/plugin-tech-radar": "^0.1.1-alpha.24",
|
||||
"@backstage/plugin-techdocs": "^0.1.1-alpha.24",
|
||||
"@backstage/plugin-welcome": "^0.1.1-alpha.24",
|
||||
"@backstage/plugin-user-settings": "^0.1.1-alpha.24",
|
||||
"@backstage/plugin-welcome": "^0.1.1-alpha.24",
|
||||
"@backstage/test-utils": "^0.1.1-alpha.24",
|
||||
"@backstage/theme": "^0.1.1-alpha.24",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
@@ -36,8 +36,8 @@
|
||||
"@octokit/rest": "^18.0.0",
|
||||
"@roadiehq/backstage-plugin-github-pull-requests": "^0.4.3",
|
||||
"@roadiehq/backstage-plugin-travis-ci": "^0.2.3",
|
||||
"dayjs": "^1.9.1",
|
||||
"history": "^5.0.0",
|
||||
"moment": "^2.27.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
/* eslint-disable no-restricted-imports */
|
||||
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
import regression, { DataPoint } from 'regression';
|
||||
import {
|
||||
Alert,
|
||||
@@ -42,17 +42,17 @@ function aggregationFor(
|
||||
duration: Duration,
|
||||
baseline: number,
|
||||
): DateAggregation[] {
|
||||
const days = moment(exclusiveEndDateOf(duration)).diff(
|
||||
const days = dayjs(exclusiveEndDateOf(duration)).diff(
|
||||
inclusiveStartDateOf(duration),
|
||||
'days',
|
||||
'day',
|
||||
);
|
||||
|
||||
return [...Array(days).keys()].reduce(
|
||||
(values: DateAggregation[], i: number): DateAggregation[] => {
|
||||
const last = values.length ? values[values.length - 1].amount : baseline;
|
||||
values.push({
|
||||
date: moment(inclusiveStartDateOf(duration))
|
||||
.add(i, 'days')
|
||||
date: dayjs(inclusiveStartDateOf(duration))
|
||||
.add(i, 'day')
|
||||
.format('YYYY-MM-DD'),
|
||||
amount: last + (baseline / 20) * (Math.random() * 2 - 1),
|
||||
});
|
||||
|
||||
@@ -9544,6 +9544,11 @@ dateformat@^3.0.0:
|
||||
resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
|
||||
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==
|
||||
|
||||
dayjs@^1.9.1:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.9.1.tgz#201a755f7db5103ed6de63ba93a984141c754541"
|
||||
integrity sha512-01NCTBg8cuMJG1OQc6PR7T66+AFYiPwgDvdJmvJBn29NGzIG+DIFxPLNjHzwz3cpFIvG+NcwIjP9hSaPVoOaDg==
|
||||
|
||||
de-indent@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
|
||||
|
||||
Reference in New Issue
Block a user