Skip to content

Use getDateString in openmeteo#4046

Merged
KristjanESPERANTO merged 1 commit intoMagicMirrorOrg:developfrom
rejas:weather
Mar 1, 2026
Merged

Use getDateString in openmeteo#4046
KristjanESPERANTO merged 1 commit intoMagicMirrorOrg:developfrom
rejas:weather

Conversation

@rejas
Copy link
Collaborator

@rejas rejas commented Mar 1, 2026

Fixes #4045

Otherwise the calculation comes to the result that its yesterday...

@KristjanESPERANTO KristjanESPERANTO merged commit 06b1361 into MagicMirrorOrg:develop Mar 1, 2026
9 checks passed
@KristjanESPERANTO
Copy link
Collaborator

Oh, this was introduced by my rewrite in #4032 – the migration from moment.format("YYYY-MM-DD") (local time) to .toISOString().split("T")[0] (UTC) was a careless mistake. I also checked envcanada.js and smhi.js, which also use toISOString(), but there it's intentional – UTC hour extraction for API URLs and timestamp storage – so they should be fine.

The new test is really nice: mocking toISOString to return a wrong date and asserting that the URL params are still correct is a good approach for this kind of regression.

@rejas rejas deleted the weather branch March 1, 2026 14:54
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