remove moment

This commit is contained in:
Samira Mokaram
2020-12-01 18:23:39 +01:00
parent fa25d9f448
commit e7807c4c79
2 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -20,21 +20,21 @@
"clean": "backstage-cli clean"
},
"dependencies": {
"@backstage/core": "^0.3.0",
"@backstage/theme": "^0.2.1",
"@backstage/catalog-model": "^0.2.0",
"@backstage/test-utils": "^0.1.2",
"@backstage/core": "^0.3.0",
"@backstage/plugin-catalog": "^0.2.1",
"@backstage/test-utils": "^0.1.2",
"@backstage/theme": "^0.2.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.45",
"date-fns": "^2.16.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-use": "^15.3.3",
"moment": "^2.27.0"
"react-use": "^15.3.3"
},
"devDependencies": {
"@backstage/cli": "^0.2.0",
"@backstage/cli": "^0.3.1",
"@backstage/dev-utils": "^0.1.3",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^10.4.1",
@@ -27,7 +27,7 @@ import {
Typography,
} from '@material-ui/core';
import { StatusError, StatusWarning } from '@backstage/core';
import moment from 'moment';
import { formatDistanceToNowStrict } from 'date-fns';
import { Incident } from '../types';
import { PagerDutyIcon } from '../PagerDutyIcon';
@@ -54,7 +54,7 @@ type Props = {
export const IncidentListItem = ({ incident }: Props) => {
const classes = useStyles();
const user = incident.assignments[0]?.assignee;
const createdAt = moment(incident.created_at).fromNow();
const createdAt = formatDistanceToNowStrict(new Date(incident.created_at));
return (
<ListItem dense key={incident.id}>
@@ -77,7 +77,7 @@ export const IncidentListItem = ({ incident }: Props) => {
}}
secondary={
<Typography noWrap variant="body2" color="textSecondary">
Created {createdAt} and assigned to{' '}
Created {createdAt} ago and assigned to{' '}
<Link
href={user?.html_url ?? '#'}
target="_blank"