From efa26f53daf36e97ef325c7537947232c90260c8 Mon Sep 17 00:00:00 2001 From: Nate-Wessel Date: Tue, 16 Jul 2024 15:27:19 +0000 Subject: [PATCH] fix timezone issue --- frontend/src/spatialData.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/spatialData.js b/frontend/src/spatialData.js index 55c7c92..b0b0f46 100644 --- a/frontend/src/spatialData.js +++ b/frontend/src/spatialData.js @@ -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 ) }