Remove seconds from message dates

Makes them easier to read
This commit is contained in:
miruka 2019-09-07 15:16:03 -04:00
parent 78119d1ef0
commit 66129a9eb2
2 changed files with 5 additions and 4 deletions

View File

@ -8,7 +8,7 @@ Row {
spacing: theme.spacing / 1.25 spacing: theme.spacing / 1.25
readonly property string eventText: Utils.processedEventText(model) readonly property string eventText: Utils.processedEventText(model)
readonly property string eventTime: Utils.formatTime(model.date) readonly property string eventTime: Utils.formatTime(model.date, false)
readonly property int eventTimeSpaces: 2 readonly property int eventTimeSpaces: 2
readonly property string hoveredLink: readonly property string hoveredLink:
@ -113,9 +113,10 @@ Row {
text: theme.chat.message.styleInclude + text: theme.chat.message.styleInclude +
eventContent.eventText + eventContent.eventText +
// time // time
" ".repeat(eventTimeSpaces) + " ".repeat(eventTimeSpaces) +
"<font size=" + theme.fontSize.small + "<font size=" + theme.fontSize.small +
"px color=" + theme.chat.message.date + ">" + "px color=" + theme.chat.message.date +
' style="vertical-align: middle">' +
eventTime + eventTime +
"</font>" + "</font>" +
// local echo icon // local echo icon

View File

@ -156,7 +156,7 @@ function formatTime(time, seconds=true) {
seconds ? Locale.LongFormat : Locale.NarrowFormat seconds ? Locale.LongFormat : Locale.NarrowFormat
).replace(/\./g, ":").replace(/ t$/, "") ).replace(/\./g, ":").replace(/ t$/, "")
// en_DK.UTF-8 locale wrongfully gives "." separators; // en_DK.UTF-8 locale wrongfully gives "." separators;
// remove the timezone at the end // also remove the timezone at the end
) )
} }