website refactor
This commit is contained in:
@@ -7,6 +7,7 @@ import { LeagueScheduleRaceViewModel } from '@/lib/view-models/LeagueScheduleVie
|
||||
import { LeagueSeasonSummaryViewModel } from '@/lib/view-models/LeagueSeasonSummaryViewModel';
|
||||
import type { RaceDTO } from '@/lib/types/generated/RaceDTO';
|
||||
import type { LeagueSeasonSummaryDTO } from '@/lib/types/generated/LeagueSeasonSummaryDTO';
|
||||
import { DateDisplay } from '@/lib/display-objects/DateDisplay';
|
||||
|
||||
function mapRaceDtoToViewModel(race: RaceDTO): LeagueScheduleRaceViewModel {
|
||||
const scheduledAt = race.date ? new Date(race.date) : new Date(0);
|
||||
@@ -17,6 +18,8 @@ function mapRaceDtoToViewModel(race: RaceDTO): LeagueScheduleRaceViewModel {
|
||||
id: race.id,
|
||||
name: race.name,
|
||||
scheduledAt,
|
||||
formattedDate: DateDisplay.formatShort(scheduledAt),
|
||||
formattedTime: DateDisplay.formatTime(scheduledAt),
|
||||
isPast,
|
||||
isUpcoming: !isPast,
|
||||
status: isPast ? 'completed' : 'scheduled',
|
||||
|
||||
Reference in New Issue
Block a user