mirror of
https://github.com/kbenestad/reimburse.git
synced 2026-06-18 08:04:31 +00:00
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
This commit is contained in:
parent
f1be8fde1b
commit
0c7bb8ac91
1 changed files with 3 additions and 0 deletions
|
|
@ -1017,6 +1017,9 @@ async function init() {
|
||||||
try {
|
try {
|
||||||
await loadConfig();
|
await loadConfig();
|
||||||
state.baseCurrency = CFG['currency-base'];
|
state.baseCurrency = CFG['currency-base'];
|
||||||
|
const p = defaultPeriod();
|
||||||
|
state.periodFrom = p.from;
|
||||||
|
state.periodTo = p.to;
|
||||||
state.items.push(newItem());
|
state.items.push(newItem());
|
||||||
render();
|
render();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue