diff --git a/static/poopGraph.js b/static/poopGraph.js index eeb0c62..49d4ade 100644 --- a/static/poopGraph.js +++ b/static/poopGraph.js @@ -1,9 +1,7 @@ const hash = window.location.hash.substring(1); -if (hash !== "") { - const [start, end] = hash.split(":"); - document.getElementById('startDate').value = start; - document.getElementById('endDate').value = end; -} +const [start, end] = (hash !== "") ? hash.split(":") : ["", ""]; +document.getElementById('startDate').value = start; +document.getElementById('endDate').value = end; fetch('/data.json') .then(resp => resp.json())