diff --git a/client/components/Message.vue b/client/components/Message.vue index 1693b68f..20aef6f5 100644 --- a/client/components/Message.vue +++ b/client/components/Message.vue @@ -100,12 +100,19 @@ export default { isPreviousSource: Boolean, }, computed: { - messageTime() { - const format = this.$store.state.settings.showSeconds - ? constants.timeFormats.msgWithSeconds - : constants.timeFormats.msgDefault; + timeFormat() { + let format; - return dayjs(this.message.time).format(format); + if (this.$store.state.settings.use12hClock) { + format = this.$store.state.settings.showSeconds ? "msg12hWithSeconds" : "msg12h"; + } else { + format = this.$store.state.settings.showSeconds ? "msgWithSeconds" : "msgDefault"; + } + + return constants.timeFormats[format]; + }, + messageTime() { + return dayjs(this.message.time).format(this.timeFormat); }, messageTimeLocale() { return localetime(this.message.time); diff --git a/client/components/Windows/Settings.vue b/client/components/Windows/Settings.vue index d07ac25a..c609e8d3 100644 --- a/client/components/Windows/Settings.vue +++ b/client/components/Windows/Settings.vue @@ -88,6 +88,16 @@ Show seconds in timestamp +
+ +

Automatic away message

diff --git a/client/js/constants.js b/client/js/constants.js index b8aacea6..59ad6e87 100644 --- a/client/js/constants.js +++ b/client/js/constants.js @@ -24,6 +24,8 @@ const condensedTypes = new Set(["chghost", "join", "part", "quit", "nick", "kick const timeFormats = { msgDefault: "HH:mm", msgWithSeconds: "HH:mm:ss", + msg12h: "hh:mm A", + msg12hWithSeconds: "hh:mm:ss A", }; // This file is required by server, can't use es6 export diff --git a/client/js/settings.js b/client/js/settings.js index 2b00fda9..2772abe5 100644 --- a/client/js/settings.js +++ b/client/js/settings.js @@ -64,6 +64,9 @@ export const config = normalizeConfig({ showSeconds: { default: false, }, + use12hClock: { + default: false, + }, statusMessages: { default: "condensed", },