From 65d68200ac2b635d3728e4714a874304945e83dd Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 3 Oct 2023 17:15:49 -0500 Subject: [PATCH] Make dayjs date parse more reliable/robust --- src/components/TeamScheduleTable.vue | 1 - src/views/ScheduleView.vue | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/TeamScheduleTable.vue b/src/components/TeamScheduleTable.vue index 1c4514d..7564a05 100644 --- a/src/components/TeamScheduleTable.vue +++ b/src/components/TeamScheduleTable.vue @@ -144,7 +144,6 @@ export default { methods: { makeScheduleRowsFromGames(games: Game[]): ScheduleRow[] { const gamesByWeekAndHomeTeam = this.groupByWeekAndHomeTeam(games) - console.log(Object.values(gamesByWeekAndHomeTeam)) return Object.values(gamesByWeekAndHomeTeam).sort((games1, games2) => games1[0].id - games2[0].id).map(games => { return { week: games[0].week, diff --git a/src/views/ScheduleView.vue b/src/views/ScheduleView.vue index f512e7a..11d670f 100644 --- a/src/views/ScheduleView.vue +++ b/src/views/ScheduleView.vue @@ -126,9 +126,11 @@ import { type LeagueInfo, fetchCurrentLeagueInfo } from '@/services/currentServi import { CURRENT_SEASON } from '@/services/utilities' import { fetchGamesBySeasonAndWeek } from '@/services/gameService' import dayjs from 'dayjs' +import customParseFormat from 'dayjs/plugin/customParseFormat' +dayjs.extend(customParseFormat) // TODO: Annually update this start date or get it from the DB -const SEASON_START_DATE: dayjs.Dayjs = dayjs('07-31-2023') +const SEASON_START_DATE: dayjs.Dayjs = dayjs('07-31-2023', 'MM/DD/YYYY') export default { name: "ScheduleView", @@ -164,8 +166,6 @@ export default { return storage }, {} as { [key: string]: Game[] }) - console.log(groupedGames, Object.values(groupedGames)) - return Object.values(groupedGames) } },