mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 01:43:43 +00:00
feat/120: prevent reflow (#166)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user