Skip to content

Commit

Permalink
fix date display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate-Wessel committed Sep 15, 2023
1 parent 03daed2 commit 89a7527
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/dateRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export class DateRange extends Factor {
}
get name(){
if(this.#startDate || this.#endDate){
let start = this.#startDate?.toLocaleDateString() ?? '???'
let end = this.#endDate?.toLocaleDateString() ?? '???'
let start = DateRange.dateFormatted(this.#startDate) ?? '???'
let end = DateRange.dateFormatted(this.#endDate) ?? '???'
return `From ${start} to ${end}`
}
return 'New Date Range'
Expand All @@ -36,7 +36,7 @@ export class DateRange extends Factor {
this.#endDate = DateRange.parseDate(input)
return this.#endDate
}
static dateFormatted(datetime){ // TODO
static dateFormatted(datetime){
if(datetime){
return datetime.toISOString().substring(0,10)
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/spatialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export class SpatialData {
// is the crossproduct of all complete/valid factors
const crossProduct = []
this.corridors.filter(c=>c.isComplete).forEach( corridor => {
this.timeRanges.filter(c=>c.isComplete).forEach( timeRange => {
this.dateRanges.filter(c=>c.isComplete).forEach( dateRange => {
this.days.filter(c=>c.isComplete).forEach( days => {
this.timeRanges.filter(tr=>tr.isComplete).forEach( timeRange => {
this.dateRanges.filter(dr=>dr.isComplete).forEach( dateRange => {
this.days.filter(d=>d.isComplete).forEach( days => {
crossProduct.push(
new TravelTimeQuery({corridor,timeRange,dateRange,days})
)
Expand Down

0 comments on commit 89a7527

Please sign in to comment.