mirror of
https://github.com/LucasKalil-Programador/world-2026-hub.git
synced 2026-07-04 17:41:28 -03:00
feat(schedule): add occurrence filter with pending result status
This commit is contained in:
parent
5cbd3e6f3d
commit
99ea02a604
6 changed files with 122 additions and 10 deletions
|
|
@ -119,7 +119,8 @@ function matchWindowMs(match) {
|
|||
// Hybrid state of a match at instant `now`: the JSON wins when it says finished
|
||||
// or live; otherwise the clock advances the state so the hero flips at kickoff
|
||||
// and again at kickoff+window with no JSON edit. Pure function, easy to reason about.
|
||||
function matchState(match, result, now) {
|
||||
// Exported so schedule.js shares the exact same hybrid rule (occurrence filter + chip).
|
||||
export function matchState(match, result, now) {
|
||||
const status = result?.status ?? 'scheduled';
|
||||
const kickoff = matchDateUTC(match).getTime();
|
||||
if (status === 'finished' || now >= kickoff + matchWindowMs(match)) return 'over';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue