reset date range if hash is empty

main
xenofem 2022-04-16 02:54:20 -04:00
parent 6b8c2062ef
commit 896ab47424
1 changed files with 3 additions and 5 deletions

View File

@ -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())