From f825240e17deb4f2a92f2d4fc4726b30f12ee47d Mon Sep 17 00:00:00 2001 From: FANGKK Date: Mon, 14 Sep 2026 12:44:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E6=96=B0=E6=95=B0=E6=8D=AE=202026-09-?= =?UTF-8?q?14=2012:44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 236d796..52a2619 100644 --- a/index.html +++ b/index.html @@ -285,7 +285,9 @@ function derive(d) { const bStart = [d.range.start, recharges[0] && recharges[0].date].filter(Boolean).sort()[0]; let cumSpend = 0, cumIn = 0; - const balanceSeries = dayRange(bStart, end).map(dt => { + // 充值日期可能晚于最后一天的消耗数据,走势图画到两者中较晚的那天,才和顶部余额一致 + const bEnd = [end, recharges.length ? recharges[recharges.length - 1].date : end].sort().pop(); + const balanceSeries = dayRange(bStart, bEnd).map(dt => { const spend = r2(rowsOn(dt).reduce((s, r) => s + r.spend, 0)); const inflow = r2(recharges.filter(x => x.date === dt).reduce((s, x) => s + x.amount, 0)); cumSpend += spend;