mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 16:33:51 +00:00
da11ef64c2
* chore: escalate stack trace to console * refactor: event finding in roll * docs: initial roll specification * refactor: call to roll * refactor: normalise index * refactor: roll into next event * refactor: hot reload on waiting to roll * refactor: wait to roll next
10 lines
349 B
TypeScript
10 lines
349 B
TypeScript
import { dayInMs } from './conversionUtils.js';
|
|
|
|
/**
|
|
* Utility function checks whether a given event should be playing now
|
|
*/
|
|
export function checkIsNow(timeStart: number, timeEnd: number, clock: number): boolean {
|
|
const normalisedEnd = timeEnd < timeStart ? timeEnd + dayInMs : timeEnd;
|
|
return timeStart <= clock && clock <= normalisedEnd;
|
|
}
|