aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/ui/Message.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-19 22:53:33 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:59 +0300
commitda8f9c3c731d7511b59b994e47762d6f0770b554 (patch)
tree695b3202e8cbbac1d88cac7ca9cce9f4e0b5ab26 /vnext/src/ui/Message.js
parenta8c7596c03ab69f5752c2d94a14160c5bc922309 (diff)
Moment -> Day.js
Diffstat (limited to 'vnext/src/ui/Message.js')
-rw-r--r--vnext/src/ui/Message.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/vnext/src/ui/Message.js b/vnext/src/ui/Message.js
index 581ede55..d45395bb 100644
--- a/vnext/src/ui/Message.js
+++ b/vnext/src/ui/Message.js
@@ -1,6 +1,10 @@
import React, { Fragment, memo, useEffect, useRef } from 'react';
-import moment from 'moment';
+import dayjs from 'dayjs';
+import utc from 'dayjs/plugin/utc';
+dayjs.extend(utc);
+import relativeTime from 'dayjs/plugin/relativeTime';
+dayjs.extend(relativeTime);
import { Link } from 'react-router-dom';
import Icon from './Icon';
@@ -54,8 +58,8 @@ export default function Message({ data, children }) {
<div className="msg-ts">
<Link to={`/${data.user.uname}/${data.mid}`} state={{ data: data }}>
<time dateTime={data.timestamp}
- title={moment.utc(data.timestamp).local().format('lll')}>
- {moment.utc(data.timestamp).fromNow()}
+ title={dayjs.utc(data.timestamp).local().format('lll')}>
+ {dayjs.utc(data.timestamp).fromNow()}
</time>
</Link>
{