From 0c7bb8ac919b2e9d964a5e9f870ddd920d501629 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 24 May 2026 16:54:38 +0000 Subject: [PATCH] Fix period initialisation order so first expense line date defaults correctly state.periodFrom was set inside render(), after newItem() was called, so the first line always got an empty date. Setting the period before pushing the first item ensures the default date is the period start. https://claude.ai/code/session_01MbwfxnjLA9KdFTrfzB55HM --- app/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/index.html b/app/index.html index f238411..b7391d2 100644 --- a/app/index.html +++ b/app/index.html @@ -1017,6 +1017,9 @@ async function init() { try { await loadConfig(); state.baseCurrency = CFG['currency-base']; + const p = defaultPeriod(); + state.periodFrom = p.from; + state.periodTo = p.to; state.items.push(newItem()); render(); } catch (e) {