Skip to content

feat: add seconds to the clock component in the dashboard - #8555

Open
samuelpert wants to merge 2 commits into
nightscout:devfrom
samuelpert:feat/clock-seconds-display
Open

feat: add seconds to the clock component in the dashboard#8555
samuelpert wants to merge 2 commits into
nightscout:devfrom
samuelpert:feat/clock-seconds-display

Conversation

@samuelpert

@samuelpert samuelpert commented Jul 6, 2026

Copy link
Copy Markdown

What does this PR do?

Adds an opt-in SHOW_SECONDS browser setting that displays live seconds on the dashboard clock, in both 12-hour and 24-hour time formats. When enabled, the clock format switches to include seconds (e.g. 2:05:09 PM / 14:05:09) and the clock refresh interval drops to 1 second so the seconds display stays live; when disabled (the default), behavior is unchanged. The setting is exposed via a checkbox in the browser Settings dialog, as an environment variable (SHOW_SECONDS), and as an Azure one-click deploy parameter.

Why was this PR needed?

This closes #8048, a feature request for a seconds-capable dashboard clock. A previous attempt (#8392) implemented the same idea and was reviewed as directionally correct, but was blocked on four issues: a no-redeclare lint error from redeclaring var interval in both branches of updateClock(), a settings test with a stale hard-coded env-var count, an Azure deploy parameter that was declared but never wired into siteConfig.appSettings, and trailing whitespace flagged by git diff --check. This PR re-implements the feature from scratch following the same pattern as existing boolean browser settings (nightMode, editMode), which avoids all four issues by construction rather than patching them after the fact.

What are the relevant issue numbers?

Closes #8048

Screenshots / Recordings (if applicable)

Screenshot 2026-07-06 at 2 20 15 PM

Does this PR meet the acceptance criteria?

  • Tests added for new/changed behavior
  • All tests passing
  • Follows project style guide
  • No breaking changes introduced

@samuelpert

Copy link
Copy Markdown
Author

Hi @AndyLow91, this is my first contribution to this project. I've fixed #8048 by adding an opt-in SHOW_SECONDS browser setting that displays live seconds on the dashboard clock. This builds on the direction from a previous attempt (#8392) and addresses the review feedback that blocked it (lint error, test count, Azure appSettings wiring, trailing whitespace). Would appreciate a review when you have time!

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