No more 2-week LCS/WS
This commit is contained in:
parent
4973659dd5
commit
233cae328e
@ -105,7 +105,7 @@
|
||||
<script lang="ts">
|
||||
import type { Game } from '@/services/apiResponseTypes'
|
||||
import { type LeagueInfo, fetchCurrentLeagueInfo } from '@/services/currentService'
|
||||
import { CHRISTMAS, CURRENT_SEASON, SEASON_START_DATE, THANKSGIVING, WEEKS_PER_SEASON } from '@/services/utilities'
|
||||
import { CHRISTMAS, CURRENT_SEASON, SEASON_START_DATE, THANKSGIVING } from '@/services/utilities'
|
||||
import { fetchGamesBySeasonAndWeek } from '@/services/gameService'
|
||||
import dayjs from 'dayjs'
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat'
|
||||
@ -196,10 +196,9 @@ export default {
|
||||
this.weekGames = await fetchGamesBySeasonAndWeek(this.seasonNumber, this.selectedWeekNumber)
|
||||
},
|
||||
isLongSeries(weekNumber: number, weekStartDate: dayjs.Dayjs): boolean {
|
||||
// current 18-week schedule has 2 week series for LCS and WS (wk 20 & 21 respectively)
|
||||
// and any game week that falls on the week of Thanksgiving or Christmas becomes a 2 week series
|
||||
return weekNumber >= WEEKS_PER_SEASON + 2
|
||||
|| Math.abs(weekStartDate.diff(THANKSGIVING, 'days')) < 6
|
||||
// current 18-week schedule has 2 week series for any game week that falls
|
||||
// on the week of Thanksgiving or Christmas
|
||||
return Math.abs(weekStartDate.diff(THANKSGIVING, 'days')) < 6
|
||||
|| Math.abs(weekStartDate.diff(CHRISTMAS, 'days')) < 6
|
||||
},
|
||||
weekSpecialInfo(weekNumber: number): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user