|
|
@ -6,6 +6,7 @@ import { MatButtonModule } from '@angular/material/button'; |
|
|
import { MatDividerModule } from '@angular/material/divider'; |
|
|
import { MatDividerModule } from '@angular/material/divider'; |
|
|
import { MatTabsModule } from '@angular/material/tabs'; |
|
|
import { MatTabsModule } from '@angular/material/tabs'; |
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
import { MatDialog } from '@angular/material/dialog'; |
|
|
|
|
|
import { MatIconModule } from '@angular/material/icon'; |
|
|
|
|
|
|
|
|
import { RaceDetailsComponent } from '../../components/race-details/race-details.component'; |
|
|
import { RaceDetailsComponent } from '../../components/race-details/race-details.component'; |
|
|
import { SeasonStandingsComponent } from '../../components/season-standings/season-standings.component'; |
|
|
import { SeasonStandingsComponent } from '../../components/season-standings/season-standings.component'; |
|
|
@ -26,6 +27,7 @@ import { NewRaceDialogComponent } from '../../components/new-race-dialog/new-rac |
|
|
MatButtonModule, |
|
|
MatButtonModule, |
|
|
MatDividerModule, |
|
|
MatDividerModule, |
|
|
MatTabsModule, |
|
|
MatTabsModule, |
|
|
|
|
|
MatIconModule, |
|
|
RaceDetailsComponent, |
|
|
RaceDetailsComponent, |
|
|
SeasonStandingsComponent, |
|
|
SeasonStandingsComponent, |
|
|
UploadReplayDialogComponent |
|
|
UploadReplayDialogComponent |
|
|
@ -79,4 +81,30 @@ export class SeasonDetailsComponent { |
|
|
forceUpdate(id: string) { |
|
|
forceUpdate(id: string) { |
|
|
this.seasonsService.updateSeason(this.seasonId); |
|
|
this.seasonsService.updateSeason(this.seasonId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isRaceOver(race: Race) { |
|
|
|
|
|
if(race == undefined) { return true;} |
|
|
|
|
|
|
|
|
|
|
|
let date = new Date(race.endDate); |
|
|
|
|
|
return Date.now() > date.getTime(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isRaceOpen(race: Race) { |
|
|
|
|
|
if(race == undefined) { return true;} |
|
|
|
|
|
|
|
|
|
|
|
let endDate = new Date(race.endDate); |
|
|
|
|
|
let startDate = new Date(race.startDate); |
|
|
|
|
|
let now = Date.now(); |
|
|
|
|
|
let over = now > endDate.getTime(); |
|
|
|
|
|
let started = now > startDate.getTime(); |
|
|
|
|
|
|
|
|
|
|
|
return started && !over; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isRacePending(race: Race) { |
|
|
|
|
|
if(race == undefined) { return true;} |
|
|
|
|
|
|
|
|
|
|
|
let date = new Date(race.startDate); |
|
|
|
|
|
return Date.now() < date.getTime(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|