mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
feat: stage manager view
small fixes in other components - message control fields have value from socket - added millis to string
This commit is contained in:
@@ -1,16 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { formatDisplay } from '../../dateConfig';
|
||||
import styles from './Countdown.module.css';
|
||||
|
||||
function formatDisplay(seconds, hideZero) {
|
||||
const format = (val) => `0${Math.floor(val)}`.slice(-2);
|
||||
const hours = seconds / 3600;
|
||||
const minutes = (seconds % 3600) / 60;
|
||||
|
||||
if (hideZero && hours < 1)
|
||||
return [minutes, seconds % 60].map(format).join(':');
|
||||
else return [hours, minutes, seconds % 60].map(format).join(':');
|
||||
}
|
||||
|
||||
export default function Countdown(props) {
|
||||
const { time, small, hideZeroHours } = props;
|
||||
const [clock, setClock] = useState(time);
|
||||
|
||||
Reference in New Issue
Block a user