mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-03 00:27:30 -05:00
Fix LUTI play-offs showing wrong dates
This commit is contained in:
@@ -94,5 +94,10 @@ function Deadline({ roundId, bestOf }: { roundId: number; bestOf: number }) {
|
||||
function useLeagueWeekStart(roundId: number) {
|
||||
const tournament = useTournament();
|
||||
|
||||
const bracketIdx = tournament.brackets.findIndex((b) =>
|
||||
b.data.round.some((r) => r.id === roundId),
|
||||
);
|
||||
if (bracketIdx !== 0) return null;
|
||||
|
||||
return resolveLeagueRoundStartDate(tournament, roundId);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ const MINUTES = {
|
||||
BO3: 30,
|
||||
BO5: 40,
|
||||
BO7: 50,
|
||||
BO9: 60,
|
||||
};
|
||||
|
||||
const STRICT_MINUTES = {
|
||||
@@ -19,6 +20,7 @@ const STRICT_MINUTES = {
|
||||
BO3: 25,
|
||||
BO5: 35,
|
||||
BO7: 45,
|
||||
BO9: 55,
|
||||
};
|
||||
|
||||
const minutesToPlay = (count: number, strict: boolean) => {
|
||||
@@ -26,6 +28,7 @@ const minutesToPlay = (count: number, strict: boolean) => {
|
||||
if (count === 3) return strict ? STRICT_MINUTES.BO3 : MINUTES.BO3;
|
||||
if (count === 5) return strict ? STRICT_MINUTES.BO5 : MINUTES.BO5;
|
||||
if (count === 7) return strict ? STRICT_MINUTES.BO7 : MINUTES.BO7;
|
||||
if (count === 9) return strict ? STRICT_MINUTES.BO9 : MINUTES.BO9;
|
||||
|
||||
logger.warn("Unknown best of count", { count });
|
||||
return MINUTES.BO5;
|
||||
|
||||
Reference in New Issue
Block a user