Normalize all DateTime values to UTC across the codebase
Npgsql requires DateTimeKind.Utc for timestamp with time zone columns. This fixes errors in transaction create/edit, budgets, reports, loans, scheduled transactions, and file imports. Changes: - TransactionService: SpecifyKind on request.Date for create, update, and transfer - BudgetService: UTC kind on all new DateTime(year, month, 1) - ReportService: UTC kind on endOfMonth; rewrite spending-by- category GroupBy to avoid untranslatable navigation properties - LoanService: UTC kind on payoff scenario date construction - ScheduledTransactionService: UTC kind on SemiMonthly date - ImportService: SpecifyKind on parsed.Date when persisting - OFX/CSV/QIF parsers: AssumeUniversal + AdjustToUniversal on all date parsing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -141,7 +141,7 @@ public class ScheduledTransactionService : IScheduledTransactionService
|
||||
Frequency.Daily => current.AddDays(1),
|
||||
Frequency.Weekly => current.AddDays(7),
|
||||
Frequency.BiWeekly => current.AddDays(14),
|
||||
Frequency.SemiMonthly => current.Day <= 15 ? new DateTime(current.Year, current.Month, Math.Min(28, DateTime.DaysInMonth(current.Year, current.Month))) : current.AddMonths(1).AddDays(-(current.Day - 1)),
|
||||
Frequency.SemiMonthly => current.Day <= 15 ? new DateTime(current.Year, current.Month, Math.Min(28, DateTime.DaysInMonth(current.Year, current.Month)), 0, 0, 0, DateTimeKind.Utc) : current.AddMonths(1).AddDays(-(current.Day - 1)),
|
||||
Frequency.Monthly => current.AddMonths(1),
|
||||
Frequency.Quarterly => current.AddMonths(3),
|
||||
Frequency.SemiAnnually => current.AddMonths(6),
|
||||
|
||||
Reference in New Issue
Block a user