Skip to content

Commit

Permalink
Use dayjs, not moment.js
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Aug 28, 2020
1 parent c1b3149 commit 9172780
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/src/forum/components/SuspendUserModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/UserSuspendedNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 9172780

Please sign in to comment.