Use dayjs, not moment.js

Refs flarum/core#2219.
This commit is contained in:
Franz Liedke 2020-08-28 18:30:52 +02:00
parent fb01d767c7
commit 400a9a6267
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ export default class SuspendUserModal extends Modal {
}
this.status = m.prop(status);
this.daysRemaining = m.prop(status === 'limited' && -moment().diff(until, 'days') + 1);
this.daysRemaining = m.prop(status === 'limited' && -dayjs().diff(until, 'days') + 1);
}
className() {
@ -88,7 +88,7 @@ export default class SuspendUserModal extends Modal {
break;
case 'limited':
suspendedUntil = moment().add(this.daysRemaining(), 'days').toDate();
suspendedUntil = dayjs().add(this.daysRemaining(), 'days').toDate();
break;
default:

View File

@ -12,7 +12,7 @@ export default class UserSuspendedNotification extends Notification {
content() {
const notification = this.props.notification;
const suspendedUntil = notification.content();
const timeReadable = moment(suspendedUntil.date).from(notification.createdAt(), true);
const timeReadable = dayjs(suspendedUntil.date).from(notification.createdAt(), true);
return app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {
user: notification.fromUser(),