1
0
mirror of https://github.com/flarum/core.git synced 2025-07-12 12:26:23 +02:00

Switch from 'moment' to 'dayjs' (#2219)

* Switch from 'moment' to 'dayjs'

* Use humanize code from duration plugin (without actual plugin) for time lapsed events
This commit is contained in:
David Sevilla Martín
2020-06-30 20:33:00 -04:00
committed by GitHub
parent 640cc0989b
commit 8dd5420405
10 changed files with 31 additions and 29 deletions

View File

@ -230,7 +230,7 @@ class PostStream extends Component {
if (dt > 1000 * 60 * 60 * 24 * 4) {
content = [
<div className="PostStream-timeGap">
<span>{app.translator.trans('core.forum.post_stream.time_lapsed_text', { period: moment.duration(dt).humanize() })}</span>
<span>{app.translator.trans('core.forum.post_stream.time_lapsed_text', { period: dayjs().add(dt, 'ms').fromNow(true) })}</span>
</div>,
content,
];