Skip to content

MID-11078 Fix false dateTime updates due to seconds normalization in admin GUI#583

Open
kay1313 wants to merge 1 commit intomasterfrom
fix/MID-11078
Open

MID-11078 Fix false dateTime updates due to seconds normalization in admin GUI#583
kay1313 wants to merge 1 commit intomasterfrom
fix/MID-11078

Conversation

@kay1313
Copy link
Copy Markdown
Contributor

@kay1313 kay1313 commented Mar 27, 2026

The admin GUI date picker operates at minute precision and drops seconds/milliseconds on submit.
The existing guard in XmlGregorianCalendarModel used GregorianCalendar.equals(...), which compares full calendar state (including timezone), not just the actual time value.

This caused false differences when:

-stored value contained seconds (e.g. 09:32:12),
-GUI round-trip produced 09:32:00,
-or calendars differed only in internal representation (e.g. timezone/configuration),
-even though both represented the same effective minute.
As a result, the GUI incorrectly overwrote values and preview showed spurious changes.

Solution

Replace strict GregorianCalendar.equals(...) with comparison of normalized minute-precision timestamps using getTimeInMillis() after stripping seconds and milliseconds.

This ensures:
-no change is produced when only GUI precision differs,
-false differences caused by calendar metadata (including timezone representation) are avoided,
-real differences in actual time are still detected.
In particular:
-real timezone differences → still cause update (correct)
-fake differences from calendar equality → no longer cause update (fixed)

@1azyman 1azyman self-requested a review March 31, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant