auto-compute TODAY-6 months
All checks were successful
cicd / cicd (push) Successful in 43s

This commit is contained in:
bel
2023-10-28 10:49:43 -06:00
parent cdad3092e1
commit 93e5a77e04
3 changed files with 30 additions and 6 deletions

View File

@@ -29,9 +29,15 @@
console.log(path, query);
document.getElementById("graph").src = window.origin + path + query
}
function init() {
const zeroPad = (num, places) => String(num).padStart(places, '0')
var d = new Date()
d.setMonth(d.getMonth()-6)
document.getElementsByName("zoomStart")[0].value = `${d.getFullYear()}-${zeroPad(d.getMonth(), 2)}`
}
</script>
</header>
<body style="height: 100%;">
<body style="height: 100%;" onload="init();">
<div id="grapher" style="width: 100%; height: 100%; display: flex; flex-direction: column;">
<form onsubmit="draw(this); return false;" style="display: flex; flex-direction: row; flex-wrap: wrap; gap: 1em;">
<span>
@@ -61,7 +67,7 @@
<span>
<label for="zoomStart">zoomStart</label>
<input name="zoomStart" type="text" value="2023-06"/>
<input name="zoomStart" type="text" value="YYYY-MM"/>
</span>
<span>