From bbdffff41f983c64052d5e58b4951ef41d4bf921 Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Mon, 29 Aug 2022 15:21:07 +0400 Subject: [PATCH] DEV: use the format-age helper on the DnD button on the new user menu (#18108) --- .../app/components/user-menu/profile-tab-content.hbs | 9 +-------- .../app/components/user-menu/profile-tab-content.js | 9 --------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.hbs b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.hbs index c1c2700ff9..08eb858280 100644 --- a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.hbs +++ b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.hbs @@ -77,14 +77,7 @@ {{#if this.isInDoNotDisturb}} {{i18n "do_not_disturb.label"}} - - {{this.doNotDisturbDateContent}} - + {{format-age this.doNotDisturbDateTime}} {{else}} {{i18n "do_not_disturb.label"}} {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.js b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.js index 6eda6055ef..661fcb891f 100644 --- a/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.js +++ b/app/assets/javascripts/discourse/app/components/user-menu/profile-tab-content.js @@ -2,7 +2,6 @@ import Component from "@glimmer/component"; import { inject as service } from "@ember/service"; import { action } from "@ember/object"; import showModal from "discourse/lib/show-modal"; -import { longDate, relativeAge } from "discourse/lib/formatter"; export default class UserMenuProfileTabContent extends Component { @service currentUser; @@ -22,14 +21,6 @@ export default class UserMenuProfileTabContent extends Component { return !!this.#doNotDisturbUntilDate; } - get doNotDisturbDateTitle() { - return longDate(this.#doNotDisturbUntilDate); - } - - get doNotDisturbDateContent() { - return relativeAge(this.#doNotDisturbUntilDate); - } - get doNotDisturbDateTime() { return this.#doNotDisturbUntilDate.getTime(); }