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
@@ -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"