UX: consistent chat message date format (#29232)

In certain locales like English (GB), If a user posted 2 subsequent messages, the first would have a date displayed in 24 hour format, while the second message would be shown in 12 hour format (when hovering the message).

This change forces both messages to display in 12 hour format, the first message showing the am/pm, and the second showing the smaller version without am/pm.
This commit is contained in:
David Battersby 2024-10-16 17:51:04 +04:00 committed by GitHub
parent 4aa923aab1
commit 6078fb73ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ export default function formatChatDate(message, options = {}) {
const display =
options.mode === "tiny"
? date.format(I18n.t("chat.dates.time_tiny"))
: date.format(I18n.t("dates.time"));
: date.format(I18n.t("chat.dates.time"));
if (message.staged) {
return htmlSafe(

View File

@ -45,6 +45,7 @@ en:
deleted_chat_username: deleted
dates:
yesterday: "Yesterday"
time: "h:mm a"
time_tiny: "h:mm"
all_loaded: "Showing all messages"
already_enabled: "Chat is already enabled on this topic. Please refresh."