Seasons
app/features/mmr/core/Seasons.tsNo overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 7 loaders4 actions8 routes5 repositories2 modules2 components4 routines5 scripts14 other
Types
Functions & values
Seasons (nth from 0) with their start and end dates. Outside production the list is a test set that keeps a season always open.
export const list = // when we do pnpm run setup NODE_ENV is not set -> use test seasons !process.env.NODE_ENV || IS_E2E_TEST_RUN || (process.env.NODE_ENV === "development" && !Config.prodMode) ? ([ { nth: 0, starts: new Date("2023-08-14T17:00:00.000Z"), ends: new Date("2023-08-27T20:59:59.999Z"), },
The current season at date (default now), falling back to the previous one.
export function currentOrPrevious(date?: Date): ListItem | null
The previous season relative to date (default now).
export function previous(date = new Date()): ListItem | null
Tests only: makes current() for "now" resolve to null as if every season had ended; an explicit date still resolves normally.
export function DANGEROUS_setSeasonEndedOverride(seasonEnded: boolean)
The ongoing season at date (default now), if any.
export function current(date?: Date): ListItem | null
The next upcoming season relative to date (default now), if any.
export function next(date = new Date()): ListItem | null
Start and end dates of season nth. @throws if the season does not exist.
export function nthToDateRange(nth: number)
Unit tests (3)
The range a season's results can land in: the season plus the reporting grace period. @throws if the season does not exist.
export function nthToReportingDateRange(nth: number)
Unit tests (3)
When the members of the season's SendouQ matches joined their groups: the reporting range widened by {@link GROUP_LIFETIME_MAX_DAYS}.
export function nthToGroupMembershipDateRange(nth: number)
Unit tests (2)
Numbers of seasons started by date (default now), newest first; [0] if none have.
export function allStarted(date = new Date())
Numbers of seasons finished by date (default now), newest first.
export function allFinished(date = new Date())