aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/Date.tsx
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2020-02-13 00:19:22 +0100
committerQuentin Gliech <quentingliech@gmail.com>2020-02-13 00:19:22 +0100
commit680dd91c0c0200bd4948173df0b601e16f511e6e (patch)
tree4d4cd8fb1fa42c3d17fa507880bd7e2b470e0d4c /webui/src/Date.tsx
parent0066f3d8c278558eeac70d3cd7ca21c360014346 (diff)
downloadgit-bug-680dd91c0c0200bd4948173df0b601e16f511e6e.tar.gz
webui: create comment form
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>
);