From 2ae12770cfcba907abff20f4c13597771d890098 Mon Sep 17 00:00:00 2001 From: Catherine Renelle <32781029+catrenelle@users.noreply.github.com> Date: Sat, 14 Feb 2026 16:33:46 -0500 Subject: [PATCH] Fix date timezone shift in loan detail maturity date computation Parse date string components directly and use Date.UTC() to avoid local timezone interpretation that shifts dates by a day in western timezones when using new Date() with date-only strings. Co-Authored-By: Claude Opus 4.6 --- frontend/src/views/loans/LoansView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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,