Skip to content

MMR · Modules

1 module · 12 exports · 1 repository · 0 e2e tests · 0 routes

Who imports who · hover a node
Depends onMMR modulesUsed bySeasons12 exportsLoaders7 filesActions4 filesRoutes8 filesRepositories5 filesSeasonSummaryimg-exportSendouQ.serversendouqComponents2 filesRoutines4 filesScripts5 filesOther14 files

Seasons

app/features/mmr/core/Seasons.ts

No 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

type

ListItem

:107

An item of Seasons.list.

export type ListItem = (typeof list)[number];

Functions & values

const

list

:16

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"),
				},
function

previous

:118

The previous season relative to date (default now).

export function previous(date = new Date()): ListItem | null
function

DANGEROUS_setSeasonEndedOverride

:130

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)
function

next

:150

The next upcoming season relative to date (default now), if any.

export function next(date = new Date()): ListItem | null
function

nthToDateRange

:159

Start and end dates of season nth. @throws if the season does not exist.

export function nthToDateRange(nth: number)
Unit tests (3)
function

nthToReportingDateRange

:172

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)
function

nthToGroupMembershipDateRange

:185

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)
function

allStarted

:195

Numbers of seasons started by date (default now), newest first; [0] if none have.

export function allStarted(date = new Date())
function

allFinished

:204

Numbers of seasons finished by date (default now), newest first.

export function allFinished(date = new Date())