From db1ebd41bdf878e710545ad097e0560c7fd14cc4 Mon Sep 17 00:00:00 2001 From: rahulbile Date: Tue, 10 Nov 2020 07:33:42 +0530 Subject: [PATCH] fix(ui): fix validation for date props [#3600] --- renderer/containers/UI/FormattedDateTime.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/renderer/containers/UI/FormattedDateTime.js b/renderer/containers/UI/FormattedDateTime.js index b66795db59c..0ee6065e71f 100644 --- a/renderer/containers/UI/FormattedDateTime.js +++ b/renderer/containers/UI/FormattedDateTime.js @@ -8,19 +8,20 @@ const mapStateToProps = state => ({ timeDisplayMode: settingsSelectors.currentConfig(state).timeDisplayMode, }) -const FormattedDateTime = ({ timeDisplayMode, format, month = 'long', value }) => { - const hour12 = timeDisplayMode && timeDisplayMode === '12hour' ? 1 : 0 +const FormattedDateTime = ({ timeDisplayMode = '12hour', format, month = 'long', value }) => { + const is12Hour = timeDisplayMode === '12hour' + switch (format) { case 'date': return case 'time': - return + return default: return (