Skip to content

Commit

Permalink
fix timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate-Wessel committed Jul 16, 2024
1 parent c428b51 commit efa26f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/spatialData.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ export class SpatialData {
fetch(`${domain}/date-range`)
.then( response => response.json() )
.then( dates => {
this.#dataDateRange.minDate = new Date(dates.minDate)
this.#dataDateRange.maxDate = new Date(dates.maxDate)
// a raw date will be parsed as UTC time then converted to local
// adding the 00:00:00 time component makes it read as local time
this.#dataDateRange.minDate = new Date(`${dates.minDate}T00:00:00`)
this.#dataDateRange.maxDate = new Date(`${dates.maxDate}T00:00:00`)
} )
}
get corridors(){ return this.#factors.filter( f => f instanceof Corridor ) }
Expand Down

0 comments on commit efa26f5

Please sign in to comment.