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