fix(display): timestamps show HH:mm only, no seconds#1574
Merged
Conversation
Phase 4 (PR #1543) added second-precision display in the plannings table when a worker's `AssignedSite.UseOneMinuteIntervals` flag was on — `formatStamp` and `getStopTimeDisplayWithSeconds` selected between `HH:mm:ss` and `HH:mm` based on the row's flag. After live testing the seconds turned out to be noise: the data layer always stores full precision regardless of the flag, so the flag only controls the display source (precise stamp vs 5-min-tick formula), not the display resolution. Drop the seconds from both methods — they now always return `HH:mm`. The `row` / `useOneMinuteIntervals` parameter on each is kept for call-site stability (the 10 HTML template invocations don't need to change). The misleading `WithSeconds` suffix on `getStopTimeDisplayWithSeconds` stays for the same reason — JSDoc on the method explains it's now historical. The dormant helper `convertHoursToTimeWithSeconds(hours)` is unchanged — no production callers, kept for potential future Excel/summary work. Tests updated: the two flag-on assertions in `time-plannings-table.component.spec.ts` now pin the "HH:mm even when flag on" contract instead of asserting seconds. The skipped playwright test in `dashboard-edit-multishift.spec.ts` has its commented expected values updated for when the fixture work eventually un-skips it. The dormant-helper test on `convertHoursToTimeWithSeconds` is preserved (it pins the helper's standalone API, which still produces `HH:mm:ss`). Out of scope: - Mobile (already done in flutter-time PR #479). - Input precision (`minutesGap` in workday-entity-dialog) — affects editing not display; stays flag-gated. - Pause-duration display — no second-precision sites found on the web. - Backend / proto / EF — all unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Reverts the second-precision display introduced in PR #1543 so plannings-table timestamps always render as HH:mm. The formatStamp and getStopTimeDisplayWithSeconds helpers retain their signatures (including the now-unused row argument and historical WithSeconds suffix) for call-site stability, with updated JSDoc explaining the change. Tests and the skipped Playwright spec are updated accordingly.
Changes:
- Drop
useOneMinuteIntervals-conditionalHH:mm:ssformatting fromformatStampandgetStopTimeDisplayWithSeconds; both always format toHH:mm. - Update the
TimePlanningModel.useOneMinuteIntervalsdoc comment to reflect that the flag no longer drives display resolution. - Adjust jest specs and the skipped Playwright spec/comments to assert
HH:mmoutput.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eform-client/.../time-planning.model.ts | JSDoc updated to reflect that the flag no longer affects display. |
| eform-client/.../time-plannings-table.component.ts | Removes seconds branch in formatStamp and getStopTimeDisplayWithSeconds. |
| eform-client/.../time-plannings-table.component.spec.ts | Test expectations updated to HH:mm regardless of flag. |
| eform-client/.../dashboard-edit-multishift.spec.ts | Skipped e2e and comments updated to the new contract. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4 (PR #1543) added second-precision display (
HH:mm:ss) in the plannings table when a worker'sAssignedSite.UseOneMinuteIntervalsflag was on. Live testing confirmed the seconds are noise: the data layer always stores full precision regardless of the flag, so the flag only controls the display source (precise stamp vs 5-min-tick formula), not the display resolution.This drops the seconds from both
formatStampandgetStopTimeDisplayWithSeconds— they now always returnHH:mm. Therowparameter is retained on both for call-site stability (the 10 HTML template invocations don't need to change). The misleadingWithSecondssuffix stays for the same reason — the JSDoc on the method explains it's now a historical name.The dormant helper
convertHoursToTimeWithSeconds(hours)is unchanged.Why
Mirrors the mobile-side decision shipped on flutter-time PR #479 (
fix(display): timestamps show HH:mm only, no seconds). The data layer keeps full precision; only the visible string changes.Test plan
npx jest --testPathPatterns='time-plannings-table.component.spec'— 47/47 pass.ng build --configuration=development— clean.UseOneMinuteIntervals = 1with a shift that has non-zero-seconds wall-clock timestamps. Verify each shift's start/stop cell displaysHH:mmonly. Cross-checkPlanRegistrations.Start1StartedAtin the DB — should still carry full-precision timestamps (data unchanged).Out of scope (track separately if needed)
minutesGapin workday-entity-dialog) — affects editing, not display; stays flag-gated.🤖 Generated with Claude Code