Replace timeago.js in favor of luxon in Sentry plugin

Signed-off-by: Vitor Capretz <capretzvitor@gmail.com>
This commit is contained in:
Vitor Capretz
2021-06-12 13:42:40 +02:00
parent 1bcb8693bf
commit 4bd96b110f
3 changed files with 17 additions and 10 deletions
@@ -17,7 +17,7 @@
import React from 'react';
import { Table, TableColumn } from '@backstage/core';
import { SentryIssue } from '../../api';
import { format } from 'timeago.js';
import { DateTime } from 'luxon';
import { ErrorCell } from '../ErrorCell/ErrorCell';
import { ErrorGraph } from '../ErrorGraph/ErrorGraph';
@@ -35,7 +35,8 @@ const columns: TableColumn[] = [
field: 'firstSeen',
render: data => {
const { firstSeen } = data as SentryIssue;
return format(firstSeen);
return DateTime.fromISO(firstSeen).toRelative({ locale: 'en' });
},
},
{
@@ -43,7 +44,7 @@ const columns: TableColumn[] = [
field: 'lastSeen',
render: data => {
const { lastSeen } = data as SentryIssue;
return format(lastSeen);
return DateTime.fromISO(lastSeen).toRelative({ locale: 'en' });
},
},
{