DEV: use the format-age helper on the DnD button on the new user menu (#18108)
This commit is contained in:
parent
bad78bfdfb
commit
bbdffff41f
|
@ -77,14 +77,7 @@
|
||||||
<span class="item-label">
|
<span class="item-label">
|
||||||
{{#if this.isInDoNotDisturb}}
|
{{#if this.isInDoNotDisturb}}
|
||||||
<span>{{i18n "do_not_disturb.label"}}</span>
|
<span>{{i18n "do_not_disturb.label"}}</span>
|
||||||
<span
|
{{format-age this.doNotDisturbDateTime}}
|
||||||
title={{this.doNotDisturbDateTitle}}
|
|
||||||
data-time={{this.doNotDisturbDateTime}}
|
|
||||||
data-format="tiny"
|
|
||||||
class="relative-date"
|
|
||||||
>
|
|
||||||
{{this.doNotDisturbDateContent}}
|
|
||||||
</span>
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{i18n "do_not_disturb.label"}}
|
{{i18n "do_not_disturb.label"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -2,7 +2,6 @@ import Component from "@glimmer/component";
|
||||||
import { inject as service } from "@ember/service";
|
import { inject as service } from "@ember/service";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import { longDate, relativeAge } from "discourse/lib/formatter";
|
|
||||||
|
|
||||||
export default class UserMenuProfileTabContent extends Component {
|
export default class UserMenuProfileTabContent extends Component {
|
||||||
@service currentUser;
|
@service currentUser;
|
||||||
|
@ -22,14 +21,6 @@ export default class UserMenuProfileTabContent extends Component {
|
||||||
return !!this.#doNotDisturbUntilDate;
|
return !!this.#doNotDisturbUntilDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
get doNotDisturbDateTitle() {
|
|
||||||
return longDate(this.#doNotDisturbUntilDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
get doNotDisturbDateContent() {
|
|
||||||
return relativeAge(this.#doNotDisturbUntilDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
get doNotDisturbDateTime() {
|
get doNotDisturbDateTime() {
|
||||||
return this.#doNotDisturbUntilDate.getTime();
|
return this.#doNotDisturbUntilDate.getTime();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue