aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/Date.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'webui/src/Date.tsx')
-rw-r--r--webui/src/Date.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/webui/src/Date.tsx b/webui/src/Date.tsx
index 9380d2fc..a830546c 100644
--- a/webui/src/Date.tsx
+++ b/webui/src/Date.tsx
@@ -1,11 +1,16 @@
import Tooltip from '@material-ui/core/Tooltip/Tooltip';
import moment from 'moment';
import React from 'react';
+import Moment from 'react-moment';
+
+const HOUR = 1000 * 3600;
+const DAY = 24 * HOUR;
+const WEEK = 7 * DAY;
type Props = { date: string };
const Date = ({ date }: Props) => (
<Tooltip title={moment(date).format('MMMM D, YYYY, h:mm a')}>
- <span> {moment(date).fromNow()} </span>
+ <Moment date={date} fromNowDuring={WEEK} />
</Tooltip>
);