Fix date display timezone shift and revert to standard monthly interest
formatDate was parsing UTC timestamps in local time, shifting dates back a day in western timezones. Strip the time portion before parsing so dates display correctly. Revert interest calculation from daily accrual back to standard monthly compounding (rate/12) with per-payment rounding. This matches how mortgage servicers calculate interest and produces correct amortization schedules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ export function formatCurrency(amount: number): string {
|
||||
}
|
||||
|
||||
export function formatDate(date: string): string {
|
||||
return format(parseISO(date), 'MM/dd/yyyy')
|
||||
return format(parseISO(date.split('T')[0]), 'MM/dd/yyyy')
|
||||
}
|
||||
|
||||
export function formatDateTime(date: string): string {
|
||||
|
||||
Reference in New Issue
Block a user