Skip to content

Make metrics and generic IDB viewers respect timezone preferences - #348

Open
sankalpsthakur wants to merge 1 commit into
inductiveautomation:mainfrom
sankalpsthakur:fix/300-idb-timezone-preference
Open

Make metrics and generic IDB viewers respect timezone preferences#348
sankalpsthakur wants to merge 1 commit into
inductiveautomation:mainfrom
sankalpsthakur:fix/300-idb-timezone-preference

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Aug 7, 2026

Copy link
Copy Markdown

Summary

Fixes #300 by finishing timezone-preference support for the metrics and generic IDB viewers (on top of the global preference from #321).

Changes

  • Generic IDB / shared tables (ReifiedJXTable): Date columns are formatted with Timezone.Default instead of a system-default SimpleDateFormat, and tables repaint when the preference changes. This also covers QuestDB result tables that share the same renderer.
  • Generic IDB (GenericView): Columns whose names contain tsmp are now instantiated as java.sql.Timestamp (not java.sql.Date) so full time-of-day is preserved when formatting in the preferred zone.
  • Metrics view (MetricsView): Adds a live Timezone: <zone-id> label above the metric cards so it's clear which zone is in use.
  • Sparklines (Sparkline): Domain DateAxis timezone tracks the preference (tooltips already did).

How tested

  • ./gradlew compileKotlin test — BUILD SUCCESSFUL (existing tests pass)
  • ./gradlew spotlessCheck — BUILD SUCCESSFUL

AI disclosure

This contribution was developed with assistance from an AI coding agent (Grok/Cursor). Changes were reviewed and validated by running the project's Gradle compile, test, and Spotless checks.

Completes remaining work from inductiveautomation#300 on top of the General timezone
preference introduced in inductiveautomation#321:

- Format Date cells in ReifiedJXTable via Timezone.Default (covers
  generic IDB and QuestDB results tables) and repaint on change
- Instantiate generic IDB "tsmp" columns as Timestamp so full time-of-day
  is preserved when formatting in the preferred zone
- Show an updating Timezone label on the metrics view
- Align sparkline DateAxis timezone with the preference

Fixes inductiveautomation#300
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.

Make the metrics and generic idb viewer respect timezone preferences

1 participant