Skip to content

Use the current UTC offset when labelling the day and month plots - #1297

Open
gskjold wants to merge 1 commit into
mainfrom
fix-dst-plot-labels
Open

gskjold wants to merge 1 commit into
mainfrom
fix-dst-plot-labels

Conversation

@gskjold

@gskjold gskjold commented Oct 25, 2026

Copy link
Copy Markdown
Member

Problem

On a DST change day (2026-10-25, 25 hours) the day plot labelled its last bar 11 at 13:25 CET instead of 12, and the repeated night hour was shifted.

DayPlot.svelte and MonthPlot.svelte computed the browser's UTC offset from noon on the last day of the previous month (Sept 30, CEST, +2) and subtracted the device's current clock_offset (CET, +1). The resulting 1-hour clock_adjust shifted every label. This happens after both DST changes, until the 1st of the next month. The code is unchanged since 2.5.x, so it isn't a 2.6 regression.

Fix

Use the browser's offset at the current time, as PricePlot.svelte already does:

let clock_adjust = -cur.getTimezoneOffset()/60 - sysinfo.clock_offset;

In MonthPlot the bug could only mislabel a day during the hour around midnight; lm is kept there for the month length.

Labels are the start of each hour, so on the autumn change the night now shows two 02 bars (00 UTC and 01 UTC), then 03.

Verification

  • Simulated the labels in Europe/Oslo for 2026-10-25 12:25 UTC: before the fix the last bar is 11, after it is 12 with 02 repeated. Labels are also correct in summer and on 2026-03-29.
  • Flashed esp32s2dev (HEAD + this change only) over OTA to a device and confirmed the served bundle contains the fix; the day plot now shows the correct hours.

🤖 Generated with Claude Code

The day and month plots derived the browser's UTC offset from noon on
the last day of the previous month, and compared it with the device's
current offset (clock_offset). From a DST change until the first of
the next month these differ by an hour, so every hour label was
shifted. On the day DST ended in Europe, the last bar was labelled 11
at 13:25 CET instead of 12, and the repeated 02 hour was off by one.

Use the browser's offset now, as the price plot already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔧 PR Build Artifacts

Version: 990d9ad

All environments built successfully. Download the zip files:

Artifacts expire after 7 days. View workflow run

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.

1 participant