MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / calculateNowPosition

Function calculateNowPosition

frontend/src/utils/guideUtils.js:276–280  ·  view source on GitHub ↗
(now, start, end)

Source from the content-addressed store, hash-verified

274};
275
276export const calculateNowPosition = (now, start, end) => {
277 if (isBefore(now, start) || isAfter(now, end)) return -1;
278 const minutesSinceStart = diff(now, start, 'minute');
279 return (minutesSinceStart / MINUTE_INCREMENT) * MINUTE_BLOCK_WIDTH;
280};
281
282export const calculateScrollPosition = (now, start) => {
283 const roundedNow = roundToNearest(now, 30);

Callers 1

TVChannelGuideFunction · 0.90

Calls 3

isBeforeFunction · 0.90
isAfterFunction · 0.90
diffFunction · 0.90

Tested by

no test coverage detected