From a9ee0c3f1d3db0916862710b2b14fe030cc1d429 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Thu, 30 Jun 2022 23:34:23 +0200 Subject: [PATCH] feat/120: prevent reflow (#166) --- client/src/common/utils/__tests__/dateConfig.test.js | 2 +- client/src/common/utils/dateConfig.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/common/utils/__tests__/dateConfig.test.js b/client/src/common/utils/__tests__/dateConfig.test.js index 031205036..9a98719ab 100644 --- a/client/src/common/utils/__tests__/dateConfig.test.js +++ b/client/src/common/utils/__tests__/dateConfig.test.js @@ -64,7 +64,7 @@ describe('test formatDisplay handles partial secs', () => { describe('test string from formatDisplay function with hidezero', () => { it('test with null values', () => { - const t = { val: null, result: '00:00:00' }; + const t = { val: null, result: '00:00' }; expect(formatDisplay(t.val, true)).toBe(t.result); }); diff --git a/client/src/common/utils/dateConfig.js b/client/src/common/utils/dateConfig.js index 1f3527cdf..cb793812c 100644 --- a/client/src/common/utils/dateConfig.js +++ b/client/src/common/utils/dateConfig.js @@ -14,7 +14,7 @@ const mth = 1000 * 60 * 60; // millis to hours */ export function formatDisplay(seconds, hideZero = false) { if (typeof seconds !== 'number') { - return '00:00:00'; + return hideZero ? '00:00' : '00:00:00'; } // add an extra 0 if necessary