From 8cbfc75ff3a3a6fc0163afa86952914c10184b26 Mon Sep 17 00:00:00 2001 From: rahulbile Date: Sun, 8 Nov 2020 17:03:17 +0530 Subject: [PATCH 1/3] feat(ui): add time display mode setting to general preferences fix #3600 --- config/default.js | 3 +++ .../Settings/SettingsFieldsGeneral.js | 24 +++++++++++++++++++ renderer/components/Settings/messages.js | 4 ++++ 3 files changed, 31 insertions(+) diff --git a/config/default.js b/config/default.js index bdda23acda4..288102ae1f9 100644 --- a/config/default.js +++ b/config/default.js @@ -21,6 +21,9 @@ module.exports = { currency: 'USD', locale: 'en', + // Default time dipslay mode (12hour|24hour). + timeDisplayMode: '12hour', + autoupdate: { active: true, channel: 'beta', diff --git a/renderer/components/Settings/SettingsFieldsGeneral.js b/renderer/components/Settings/SettingsFieldsGeneral.js index 83af5d48873..7cb9d36a43b 100644 --- a/renderer/components/Settings/SettingsFieldsGeneral.js +++ b/renderer/components/Settings/SettingsFieldsGeneral.js @@ -26,6 +26,15 @@ const themeMessageMapper = key => { return filters[key] } +const displayModeItems = [{ key: '12hour' }, { key: '24hour' }] +const displayModeMessageMapper = key => { + const filters = { + '12hour': messages.timeDisplayMode_option_12hour, + '24hour': messages.timeDisplayMode_option_24hour, + } + return filters[key] +} + const SettingsFieldsGeneral = ({ currentConfig }) => { return ( <> @@ -72,6 +81,21 @@ const SettingsFieldsGeneral = ({ currentConfig }) => { + } + right={ +