Skip to content

Commit

Permalink
wrap date fields in Tournament with new Date()
Browse files Browse the repository at this point in the history
lets us convert strings to dates w/o impacting current functionality
  • Loading branch information
smayya337 committed Apr 8, 2023
1 parent 13f6ea0 commit 06448ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/interpreter/tournament.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,14 @@ export default class Tournament implements Model<TournamentRep> {
this.perEventN = rep["per-event n"];
this.nOffset = rep["n offset"] ?? 0;

this.date = rep.date;
this.startDate = rep["start date"] ?? this.date;
this.endDate = rep["end date"] ?? this.startDate;
this.awardsDate = rep["awards date"] ?? this.endDate;
this.date = rep.date ? new Date(rep.date) : undefined;
this.startDate = rep["start date"]
? new Date(rep["start date"])
: this.date;
this.endDate = rep["end date"] ? new Date(rep["end date"]) : this.startDate;
this.awardsDate = rep["awards date"]
? new Date(rep["awards date"])
: this.endDate;
this.testRelease = rep["test release"];
}

Expand Down

0 comments on commit 06448ee

Please sign in to comment.