Skip to content

fix(display): timestamps show HH:mm only, no seconds#1574

Merged
renemadsen merged 1 commit into
stablefrom
feat/web-drop-seconds-from-timestamps
May 14, 2026
Merged

fix(display): timestamps show HH:mm only, no seconds#1574
renemadsen merged 1 commit into
stablefrom
feat/web-drop-seconds-from-timestamps

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

Phase 4 (PR #1543) added second-precision display (HH:mm:ss) in the plannings table when a worker's AssignedSite.UseOneMinuteIntervals flag 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 formatStamp and getStopTimeDisplayWithSeconds — they now always return HH:mm. The row parameter is retained on both for call-site stability (the 10 HTML template invocations don't need to change). The misleading WithSeconds suffix 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.
  • CI green.
  • Manual smoke: open the plannings table for a worker whose AssignedSite has UseOneMinuteIntervals = 1 with a shift that has non-zero-seconds wall-clock timestamps. Verify each shift's start/stop cell displays HH:mm only. Cross-check PlanRegistrations.Start1StartedAt in the DB — should still carry full-precision timestamps (data unchanged).

Out of scope (track separately if needed)

  • 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.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 14, 2026 03:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-conditional HH:mm:ss formatting from formatStamp and getStopTimeDisplayWithSeconds; both always format to HH:mm.
  • Update the TimePlanningModel.useOneMinuteIntervals doc comment to reflect that the flag no longer drives display resolution.
  • Adjust jest specs and the skipped Playwright spec/comments to assert HH:mm output.

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.

@renemadsen renemadsen merged commit 8bd87b2 into stable May 14, 2026
42 checks passed
@renemadsen renemadsen deleted the feat/web-drop-seconds-from-timestamps branch May 14, 2026 03:49
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.

2 participants