feat/120: prevent reflow (#166)

This commit is contained in:
Carlos Valente
2022-06-30 23:34:23 +02:00
committed by GitHub
parent f4c5a2bf87
commit a9ee0c3f1d
2 changed files with 2 additions and 2 deletions
@@ -64,7 +64,7 @@ describe('test formatDisplay handles partial secs', () => {
describe('test string from formatDisplay function with hidezero', () => { describe('test string from formatDisplay function with hidezero', () => {
it('test with null values', () => { 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); expect(formatDisplay(t.val, true)).toBe(t.result);
}); });
+1 -1
View File
@@ -14,7 +14,7 @@ const mth = 1000 * 60 * 60; // millis to hours
*/ */
export function formatDisplay(seconds, hideZero = false) { export function formatDisplay(seconds, hideZero = false) {
if (typeof seconds !== 'number') { if (typeof seconds !== 'number') {
return '00:00:00'; return hideZero ? '00:00' : '00:00:00';
} }
// add an extra 0 if necessary // add an extra 0 if necessary