Skip to content

Parse utilities due dates as local dates#28

Merged
mihape merged 1 commit into
mainfrom
fix-utilities-local-due-dates
Jun 30, 2026
Merged

Parse utilities due dates as local dates#28
mihape merged 1 commit into
mainfrom
fix-utilities-local-due-dates

Conversation

@mihape

@mihape mihape commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • parse utilities/rent due-date strings as local date-input values
  • reuse the same local day calculation for due text, overdue styling, and open-balance sorting
  • prevent today/tomorrow balances from being overcounted in Hungary and other UTC+ time zones

Tests

  • git diff --check
  • node --check src/modules/utilities/utilities.module.js
  • targeted VM render smoke test for today/tomorrow/yesterday due-date labels

Closes #27

@mihape mihape merged commit d55928c into main Jun 30, 2026
1 check passed
@mihape mihape deleted the fix-utilities-local-due-dates branch June 30, 2026 09:15

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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]));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Parse utilities due dates as local dates

1 participant