view data fixes
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
|
||||
export interface LeagueScheduleRaceViewModel extends ViewModel {
|
||||
export class LeagueScheduleRaceViewModel extends ViewModel {
|
||||
constructor(private readonly data: any) {
|
||||
super();
|
||||
}
|
||||
|
||||
get id(): string { return this.data.id; }
|
||||
get name(): string { return this.data.name; }
|
||||
get scheduledAt(): Date { return new Date(this.data.scheduledAt); }
|
||||
get formattedDate(): string { return this.data.formattedDate; }
|
||||
get formattedTime(): string { return this.data.formattedTime; }
|
||||
get isPast(): boolean { return this.data.isPast; }
|
||||
get isUpcoming(): boolean { return this.data.isUpcoming; }
|
||||
get status(): string { return this.data.status; }
|
||||
get track(): string | undefined { return this.data.track; }
|
||||
get car(): string | undefined { return this.data.car; }
|
||||
get sessionType(): string | undefined { return this.data.sessionType; }
|
||||
get isRegistered(): boolean | undefined { return this.data.isRegistered; }
|
||||
}
|
||||
|
||||
export interface ILeagueScheduleRaceViewModel extends ViewModel {
|
||||
id: string;
|
||||
name: string;
|
||||
scheduledAt: Date;
|
||||
|
||||
Reference in New Issue
Block a user