From e25a634cf64f17decfc0a8973ae3cd2bf561fe4e Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Thu, 17 Jan 2019 12:05:34 +0000 Subject: [PATCH] allow dates for starting timerange to be in config --- src/store/initial.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/store/initial.js b/src/store/initial.js index e517108..9cb4a2a 100644 --- a/src/store/initial.js +++ b/src/store/initial.js @@ -40,8 +40,8 @@ const initial = { }, filters: { timerange: [ - d3.timeParse("%Y-%m-%dT%H:%M:%S")("2013-02-23T12:00:00"), - d3.timeParse("%Y-%m-%dT%H:%M:%S")("2016-02-23T12:00:00") + new Date(2013, 2, 23, 12), + new Date(2016, 2, 23, 12) ], mapBounds: null, tags: [], @@ -107,4 +107,9 @@ if (process.env.store) { } else { appStore = initial } + +// NB: config.js dates get implicitly converted to strings in mergeDeepLeft +appStore.app.filters.timerange[0] = new Date(appStore.app.filters.timerange[0]) +appStore.app.filters.timerange[1] = new Date(appStore.app.filters.timerange[1]) + export default appStore