mirror of
https://github.com/discourse/discourse.git
synced 2025-04-08 09:20:45 +08:00
FIX: Remove timezone in brackets from user card (#9567)
For clarity and to save space remove the timezone in brackets e.g. (EDT) from the user card. Also add a title to the user time span to say it is Local Time.
This commit is contained in:
parent
0d519c78fb
commit
17ca47af1a
@ -77,7 +77,7 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
|||||||
|
|
||||||
@discourseComputed("userTimezone")
|
@discourseComputed("userTimezone")
|
||||||
formattedUserLocalTime(timezone) {
|
formattedUserLocalTime(timezone) {
|
||||||
return moment.tz(timezone).format(I18n.t("dates.time_with_zone"));
|
return moment.tz(timezone).format(I18n.t("dates.time"));
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("username")
|
@discourseComputed("username")
|
||||||
|
@ -171,7 +171,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if showUserLocalTime}}
|
{{#if showUserLocalTime}}
|
||||||
<span class="local-time">
|
<span class="local-time" title="{{i18n "local_time"}}">
|
||||||
{{d-icon "far-clock"}}
|
{{d-icon "far-clock"}}
|
||||||
<span>{{this.formattedUserLocalTime}}</span>
|
<span>{{this.formattedUserLocalTime}}</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -1444,6 +1444,7 @@ en:
|
|||||||
mute: Mute
|
mute: Mute
|
||||||
unmute: Unmute
|
unmute: Unmute
|
||||||
last_post: Posted
|
last_post: Posted
|
||||||
|
local_time: "Local Time"
|
||||||
time_read: Read
|
time_read: Read
|
||||||
time_read_recently: "%{time_read} recently"
|
time_read_recently: "%{time_read} recently"
|
||||||
time_read_tooltip: "%{time_read} total time read"
|
time_read_tooltip: "%{time_read} total time read"
|
||||||
|
@ -25,11 +25,10 @@ QUnit.test("user card local time", async assert => {
|
|||||||
assert.ok(invisible(".user-card"), "user card is invisible by default");
|
assert.ok(invisible(".user-card"), "user card is invisible by default");
|
||||||
await click("a[data-user-card=eviltrout]:first");
|
await click("a[data-user-card=eviltrout]:first");
|
||||||
|
|
||||||
let expectedTime =
|
let expectedTime = moment
|
||||||
moment
|
|
||||||
.tz("Australia/Brisbane")
|
.tz("Australia/Brisbane")
|
||||||
.add(-2, "hours")
|
.add(-2, "hours")
|
||||||
.format("hh:mm a") + " (AWST)";
|
.format("h:mm a");
|
||||||
|
|
||||||
assert.ok(visible(".user-card"), "card should appear");
|
assert.ok(visible(".user-card"), "card should appear");
|
||||||
assert.equal(
|
assert.equal(
|
||||||
@ -51,11 +50,10 @@ QUnit.test("user card local time", async assert => {
|
|||||||
|
|
||||||
await click("a[data-user-card=charlie]:first");
|
await click("a[data-user-card=charlie]:first");
|
||||||
|
|
||||||
expectedTime =
|
expectedTime = moment
|
||||||
moment
|
|
||||||
.tz("Australia/Brisbane")
|
.tz("Australia/Brisbane")
|
||||||
.add(-14, "hours")
|
.add(-14, "hours")
|
||||||
.format("hh:mm a") + " (EDT)";
|
.format("h:mm a");
|
||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
find(".user-card .local-time")
|
find(".user-card .local-time")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user