mirror of
https://github.com/kbenestad/reimburse.git
synced 2026-06-18 16:04:31 +00:00
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:
parent
0c7bb8ac91
commit
ab7a17c971
1 changed files with 2 additions and 1 deletions
|
|
@ -368,7 +368,8 @@ function renderLine(ln, item) {
|
||||||
const baseCur = state.baseCurrency;
|
const baseCur = state.baseCurrency;
|
||||||
|
|
||||||
// Row 1: Date, Vendor, Currency, FX Rate
|
// 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');
|
if (ln.date && !isDateInPeriod(ln.date)) dateIn.classList.add('input-warn');
|
||||||
dateIn.addEventListener('change', async () => {
|
dateIn.addEventListener('change', async () => {
|
||||||
ln.date = dateIn.value;
|
ln.date = dateIn.value;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue