mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-07 23:39:09 +00:00
refactor: review studio design
This commit is contained in:
committed by
Carlos Valente
parent
3cd6cd2f55
commit
e0f2830072
@@ -0,0 +1,21 @@
|
||||
import { secondsInMillis } from 'ontime-utils';
|
||||
|
||||
import { formatTime } from '../../common/utils/time';
|
||||
|
||||
/**
|
||||
* Gathers display elements for the large studio clock
|
||||
*/
|
||||
export function getLargeClockData(clock: number) {
|
||||
const [display, meridian] = (() => {
|
||||
const formatted = formatTime(clock);
|
||||
if (formatted.endsWith('AM')) {
|
||||
return [formatted.slice(0, -2), 'AM'];
|
||||
}
|
||||
if (formatted.endsWith('PM')) {
|
||||
return [formatted.slice(0, -2), 'PM'];
|
||||
}
|
||||
return [formatted, undefined];
|
||||
})();
|
||||
|
||||
return { seconds: secondsInMillis(clock), display, meridian };
|
||||
}
|
||||
Reference in New Issue
Block a user