Make dayjs date parse more reliable/robust
This commit is contained in:
parent
ddb0e624cb
commit
65d68200ac
@ -144,7 +144,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
makeScheduleRowsFromGames(games: Game[]): ScheduleRow[] {
|
makeScheduleRowsFromGames(games: Game[]): ScheduleRow[] {
|
||||||
const gamesByWeekAndHomeTeam = this.groupByWeekAndHomeTeam(games)
|
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 Object.values(gamesByWeekAndHomeTeam).sort((games1, games2) => games1[0].id - games2[0].id).map(games => {
|
||||||
return {
|
return {
|
||||||
week: games[0].week,
|
week: games[0].week,
|
||||||
|
|||||||
@ -126,9 +126,11 @@ import { type LeagueInfo, fetchCurrentLeagueInfo } from '@/services/currentServi
|
|||||||
import { CURRENT_SEASON } from '@/services/utilities'
|
import { CURRENT_SEASON } 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'
|
||||||
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
// TODO: Annually update this start date or get it from the DB
|
// 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 {
|
export default {
|
||||||
name: "ScheduleView",
|
name: "ScheduleView",
|
||||||
@ -164,8 +166,6 @@ export default {
|
|||||||
return storage
|
return storage
|
||||||
}, {} as { [key: string]: Game[] })
|
}, {} as { [key: string]: Game[] })
|
||||||
|
|
||||||
console.log(groupedGames, Object.values(groupedGames))
|
|
||||||
|
|
||||||
return Object.values(groupedGames)
|
return Object.values(groupedGames)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user