Set date input .value property directly so picker opens to the correct month

setAttribute only sets the defaultValue attribute; the browser date picker
uses the .value property to determine which month to show on open.

https://claude.ai/code/session_01MbwfxnjLA9KdFTrfzB55HM
This commit is contained in:
Claude 2026-05-24 16:58:15 +00:00
parent 0c7bb8ac91
commit ab7a17c971
No known key found for this signature in database

View file

@ -368,7 +368,8 @@ function renderLine(ln, item) {
const baseCur = state.baseCurrency;
// Row 1: Date, Vendor, Currency, FX Rate
const dateIn = el('input', {type:'date', value: ln.date, style:{width:'150px'}});
const dateIn = el('input', {type:'date', style:{width:'150px'}});
if (ln.date) dateIn.value = ln.date;
if (ln.date && !isDateInPeriod(ln.date)) dateIn.classList.add('input-warn');
dateIn.addEventListener('change', async () => {
ln.date = dateIn.value;