Parse utilities due dates as local dates#28
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c52269f9fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function parseLocalDate(value) { | ||
| var match = String(value || "").match(/^(\d{4})-(\d{2})-(\d{2})$/); | ||
| if (match) { | ||
| return new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3])); |
There was a problem hiding this comment.
Fix default due dates before local parsing
In UTC+ browsers, dueDateForMonth() still creates the intended 10th as a local Date and then serializes it with toISOString(), so a May settlement stores 2026-06-09 instead of 2026-06-10. With this new local parser, that stored fallback is now treated as June 9 local, so freshly created utility settlements in Hungary are shown and flagged as due/overdue one calendar day early; the previous UTC parsing happened to mask this for the default-generated dates. Please either format dueDateForMonth as a local YYYY-MM-DD string or keep one consistent parsing convention.
Useful? React with 👍 / 👎.
Summary
Tests
Closes #27