mirror of
https://github.com/flarum/core.git
synced 2025-10-22 20:26:15 +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:
committed by
GitHub
parent
640cc0989b
commit
8dd5420405
@@ -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,
|
||||
];
|
||||
|
@@ -239,7 +239,7 @@ export default class PostStreamScrubber extends Component {
|
||||
|
||||
this.index = index;
|
||||
this.visible = visible;
|
||||
this.description = period ? moment(period).format('MMMM YYYY') : '';
|
||||
this.description = period ? dayjs(period).format('MMMM YYYY') : '';
|
||||
}
|
||||
|
||||
config(isInitialized, context) {
|
||||
|
Reference in New Issue
Block a user