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

@@ -23,6 +23,13 @@
}
f = "." + f
function init() {
const zeroPad = (num, places) => String(num).padStart(places, '0')
var d = new Date()
d.setMonth(d.getMonth()-6)
const replacement = `${d.getFullYear()}-${zeroPad(d.getMonth(), 2)}`
var iframe = document.getElementsByTagName("iframe")[0]
iframe.src = iframe.src.replace("YYYY-MM", replacement)
load(f)
}
function load(f) {
@@ -71,7 +78,7 @@
</div>
<details>
<summary><i>Look at this graph</i></summary>
<iframe style="background: white; width: 100%;" src="/api/reg?x=y&mode=reg&likeName=Withdrawal:[0123]&chart=stack&predictionMonths=6&prediction=autoContributions=&bpi=true&zoomStart=2023-01"></iframe>
<iframe style="background: white; width: 100%;" src="/api/reg?x=y&mode=reg&likeName=Withdrawal:[0123]&chart=stack&predictionMonths=6&prediction=autoContributions=&bpi=true&zoomStart=YYYY-MM"></iframe>
</details>
</details>
<details open>