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); console.log(path, query);
document.getElementById("graph").src = window.origin + 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> </script>
</header> </header>
<body style="height: 100%;"> <body style="height: 100%;" onload="init();">
<div id="grapher" style="width: 100%; height: 100%; display: flex; flex-direction: column;"> <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;"> <form onsubmit="draw(this); return false;" style="display: flex; flex-direction: row; flex-wrap: wrap; gap: 1em;">
<span> <span>
@@ -61,7 +67,7 @@
<span> <span>
<label for="zoomStart">zoomStart</label> <label for="zoomStart">zoomStart</label>
<input name="zoomStart" type="text" value="2023-06"/> <input name="zoomStart" type="text" value="YYYY-MM"/>
</span> </span>
<span> <span>

View File

@@ -1,14 +1,25 @@
<html style="height: calc(100% - 4em);"> <html style="height: calc(100% - 4em);">
<header> <header>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.css">
<script>
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 anchors = document.getElementsByTagName("a")
for (var i = 0; i < anchors.length; i++)
anchors[i].href = anchors[i].href.replace("YYYY-MM", replacement)
}
</script>
</header> </header>
<body style="height: 100%;"> <body style="height: 100%;" onload="init();">
<h1>Moolah2 Hub</h1> <h1>Moolah2 Hub</h1>
<ul style="line-height: 3em;"> <ul style="line-height: 3em;">
<li><a href="/public/transactions.html">Transactions on Shared Chase</a></li> <li><a href="/public/transactions.html">Transactions on Shared Chase</a></li>
<li><a href="/public/explore.html">Explore Bel's Money</a></li> <li><a href="/public/explore.html">Explore Bel's Money</a></li>
<li><a href="/api/bal?x=y&mode=bal&likeName=AssetAccount&chart=stack&predictionMonths=120&bpi=true&zoomStart=2023-06&prediction=interest=AssetAccount:Cash%20\$%200.02&prediction=contributions=AssetAccount:Bonds%20$%201875&prediction=interest=AssetAccount:Monthly%20\$%200.03&prediction=contributions=AssetAccount:Monthly%20$%202500&predictFixedGrowth=VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03&whatIf=AssetAccount:Cash%20$%20-.10000&=">Project Bel's Net Worth</a></li> <li><a href="/api/bal?x=y&mode=bal&likeName=AssetAccount&chart=stack&predictionMonths=120&bpi=true&zoomStart=YYYY-MM&prediction=interest=AssetAccount:Cash%20\$%200.02&prediction=contributions=AssetAccount:Bonds%20$%201875&prediction=interest=AssetAccount:Monthly%20\$%200.03&prediction=contributions=AssetAccount:Monthly%20$%202500&predictFixedGrowth=VBTLX=0.02&predictFixedGrowth=GLD=0.02&predictFixedGrowth=FXAIX=0.03&predictFixedGrowth=FSPSX=0.03&whatIf=AssetAccount:Cash%20$%20-.10000&=">Project Bel's Net Worth</a></li>
<li><a href="/api/reg?x=y&mode=reg&likeName=Withdrawal:&chart=stack&predictionMonths=3&bpi=false&zoomStart=2023-01&prediction=autoContributions=&predictFixedGrowth=VBTLX=0&whatIf=AssetAccount:Cash%20$%20-.10000&=">Expect Bel's Expenses</a></li> <li><a href="/api/reg?x=y&mode=reg&likeName=Withdrawal:&chart=stack&predictionMonths=3&bpi=false&zoomStart=YYYY-MM&prediction=autoContributions=&predictFixedGrowth=VBTLX=0&whatIf=AssetAccount:Cash%20$%20-.10000&=">Expect Bel's Expenses</a></li>
</ul> </ul>
</body> </body>
<footer> <footer>

View File

@@ -23,6 +23,13 @@
} }
f = "." + f f = "." + f
function init() { 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) load(f)
} }
function load(f) { function load(f) {
@@ -71,7 +78,7 @@
</div> </div>
<details> <details>
<summary><i>Look at this graph</i></summary> <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> </details>
<details open> <details open>