Skip to content

Display dashboard charts in Gladys system timezone - #2648

Draft
Pierre-Gilles wants to merge 1 commit into
masterfrom
cursor/chart-system-timezone-b2d1
Draft

Display dashboard charts in Gladys system timezone#2648
Pierre-Gilles wants to merge 1 commit into
masterfrom
cursor/chart-system-timezone-b2d1

Conversation

@Pierre-Gilles

Copy link
Copy Markdown
Contributor

Summary

Fixes the feature request from community topic #9286: dashboard charts now display dates and times in the Gladys system timezone (configured in Settings → System → Timezone) instead of the browser/device local timezone.

This matters when accessing Gladys remotely from a different timezone (e.g. via VPN while traveling): a water heater starting at 22:00 at home will now correctly show 22:00 on the chart, even if the phone is set to GMT-04.

Changes

  • Load the Gladys system timezone into the global store on session initialization
  • Add a systemTimezone utility (front/src/utils/systemTimezone.js) using dayjs timezone plugin
  • Update ApexChartComponent to format x-axis labels and tooltips in the system timezone (line, area, bar, stepline, timeline charts)
  • Update the energy consumption box chart tooltips and x-axis labels similarly
  • Refresh the store timezone immediately when changed in system settings

Test plan

  • npm run prettier and npm run prettier-check in front/
  • npm run eslint in front/
  • Verify chart x-axis and tooltip times match Gladys timezone when browser timezone differs (e.g. change laptop timezone or use devtools)
  • Verify energy consumption box chart uses system timezone
  • Verify changing timezone in Settings → System updates charts without page reload
Open in Web Open in Cursor 

When accessing Gladys remotely from a different timezone (e.g. via VPN),
chart axes and tooltips were shown in the browser local time instead of
the Gladys system timezone configured in settings.

- Load system timezone into global store on session init
- Format ApexCharts axis labels and tooltips using dayjs timezone
- Apply same timezone formatting to energy consumption charts
- Refresh store timezone when changed in system settings

Co-authored-by: Pierre-Gilles Leymarie <Pierre-Gilles@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f21ed039-7d8a-4850-a731-e18cfcff5d68

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/chart-system-timezone-b2d1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gladys-plus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f9bb5e
Status: ✅  Deploy successful!
Preview URL: https://e693d5c6.gladys-plus.pages.dev
Branch Preview URL: https://cursor-chart-system-timezone.gladys-plus.pages.dev

View logs

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.98%. Comparing base (0b421b1) to head (7f9bb5e).
⚠️ Report is 103 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2648   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files        1056     1056           
  Lines       20986    20986           
=======================================
  Hits        20773    20773           
  Misses        213      213           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added area:front Preact front-end type:feature New user-facing feature or improvement labels Jul 31, 2026
@Pierre-Gilles Pierre-Gilles added the needs:cursor-review Automated review by Cursor is needed label Aug 6, 2026 — with Cursor
@Pierre-Gilles Pierre-Gilles removed the needs:cursor-review Automated review by Cursor is needed label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Preact front-end type:feature New user-facing feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants