diff --git a/frontend/src/views/loans/LoansView.vue b/frontend/src/views/loans/LoansView.vue index abc4e26..2bf6d07 100644 --- a/frontend/src/views/loans/LoansView.vue +++ b/frontend/src/views/loans/LoansView.vue @@ -367,12 +367,12 @@ async function saveLoanDetail() { if (!props.id) return saving.value = true try { - const originDate = new Date(loanForm.value.originationDate) - const maturityDate = new Date(originDate) - maturityDate.setMonth(maturityDate.getMonth() + loanForm.value.termMonths) + const [year, month, day] = loanForm.value.originationDate.split('-').map(Number) + const maturityDate = new Date(Date.UTC(year, month - 1 + loanForm.value.termMonths, day)) const payload = { ...loanForm.value, + originationDate: new Date(Date.UTC(year, month - 1, day)).toISOString(), maturityDate: maturityDate.toISOString(), escrowAmount: loanForm.value.escrowAmount || undefined, extraPayment: loanForm.value.extraPayment || undefined,