fix: 修复日期选择器显示NaN问题

- detail.vue: 修正onDateChange方法,使用e.detail.value获取日期值
- 原生picker返回的是日期字符串,无需Date解析
This commit is contained in:
claw_bot 2026-03-13 10:24:40 +00:00
parent 8584640282
commit 838ce7fb1d

View File

@ -580,12 +580,9 @@ const resetTransactionForm = () => {
}; };
const onDateChange = (e) => { const onDateChange = (e) => {
const date = new Date(e.value); // picker YYYY-MM-DD
const year = date.getFullYear(); transactionForm.value.transactionDate = e.detail.value;
const month = String(date.getMonth() + 1).padStart(2, '0'); transactionForm.value.dateTimestamp = new Date(e.detail.value).getTime();
const day = String(date.getDate()).padStart(2, '0');
transactionForm.value.transactionDate = `${year}-${month}-${day}`;
transactionForm.value.dateTimestamp = e.value;
}; };
const submitTransaction = async () => { const submitTransaction = async () => {