diff --git a/src/actions/tree.js b/src/actions/tree.js index a5f7de910..ed2adcd4b 100644 --- a/src/actions/tree.js +++ b/src/actions/tree.js @@ -151,8 +151,8 @@ export const changeDateFilter = ({newMin = false, newMax = false, quickdraw = fa const { tree, treeToo, controls, frequencies } = getState(); if (!tree.nodes) {return;} const dates = { - dateMinNumeric: newMin ? calendarToNumeric(newMin) : controls.dateMinNumeric, - dateMaxNumeric: newMax ? calendarToNumeric(newMax) : controls.dateMaxNumeric + dateMinNumeric: newMin ? calendarToNumeric(newMin) : Math.min(controls.dateMinNumeric, tree.nodesByNumDate[0][0]), + dateMaxNumeric: newMax ? calendarToNumeric(newMax) : Math.max(controls.dateMaxNumeric, tree.nodesByNumDate[tree.nodesByNumDate.length-1][0]) }; const data = calculateVisiblityAndBranchThickness(tree, controls, dates); const dispatchObj = { diff --git a/src/reducers/controls.ts b/src/reducers/controls.ts index 5290c2440..e9ebafe01 100644 --- a/src/reducers/controls.ts +++ b/src/reducers/controls.ts @@ -78,8 +78,8 @@ export const getDefaultControlsState = () => { defaults.sidebarOpen = initialSidebarState.sidebarOpen; } - const dateMin = numericToCalendar(currentNumDate() - defaultDateRange); - const dateMax = currentCalDate(); + const dateMin = numericToCalendar(1900); + const dateMax = numericToCalendar(currentNumDate() + 100); // 100 years into the future const dateMinNumeric = calendarToNumeric(dateMin); const dateMaxNumeric = calendarToNumeric(dateMax); return {