mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
Feat/seconds (#38)
* change directory structure move test file to __tests__ at the module directory * test function Add more tests to ensure the function remains safe * fix coverage filter * change directory structure move to utilities folder * refract formatDisplay with tst * test millis * test millis to seconds * refract millis functions * refractor timeStringToMillis * create utility consts * style component * fixed bug with hidezero parameter * fix issue with cancelling input edit * style tweak
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { memo } from 'react';
|
||||
import { formatDisplay } from 'common/dateConfig';
|
||||
import { formatDisplay } from 'common/utils/dateConfig';
|
||||
import styles from './Countdown.module.css';
|
||||
|
||||
const Countdown = ({ time, small, negative, hideZeroHours }) => {
|
||||
let display = '-- : -- : --';
|
||||
|
||||
// prepare display string
|
||||
if (time != null && !isNaN(time))
|
||||
display = formatDisplay(Math.abs(time), hideZeroHours);
|
||||
const display =
|
||||
time != null && !isNaN(time)
|
||||
? formatDisplay(time, hideZeroHours)
|
||||
: '-- : -- : --';
|
||||
|
||||
const colour = negative ? '#ff7597' : '#fffffa';
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user