Skip to content

refactor(calendar): extract time formatting - #4341

Merged
khassel merged 2 commits into
MagicMirrorOrg:developfrom
KristjanESPERANTO:calendar
Nov 12, 2026
Merged

khassel merged 2 commits into
MagicMirrorOrg:developfrom
KristjanESPERANTO:calendar

Conversation

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

While working on #4340, I took a closer look at the Calendar tests and saw potential for separating the DOM code from the logic that builds the time text.

I extracted the time-formatting logic from calendar.js to calendarutils.mjs so it can be tested directly with unit tests. That let me replace 8 E2E tests with unit tests, which I find easier to understand. They are also faster. The remaining E2E tests still cover the whole path.

I think there is more potential in this direction (e.g. the dateheaders path), but this PR is already big enough.

@khassel
khassel merged commit 1e2ec04 into MagicMirrorOrg:develop Nov 12, 2026
13 checks passed
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