grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
133 stars 20 forks source link

Macros: Resolve browser timezone for `$__timezone` #759

Closed ivanortegaalba closed 4 months ago

ivanortegaalba commented 4 months ago

A bug was reported when resolving $__timezone in scenes compared with the behavior in Grafana Dashboards.

In Grafana Dashboards, when the browser timezone is selected, the value of the timezone is resolved. For scenes, the value returned is browser. This breaks some data sources queries when they use $__timezone.

Before After
Captura de pantalla 2024-05-30 a las 10 18 22 Captura de pantalla 2024-05-30 a las 10 18 36

In Grafana, to get the browser timezone is done through moment. moment is not a dependency of Scenes and is not needed, so we're using Intl.

📦 Published PR as canary version: 4.24.3--canary.759.9299159504.0
:sparkles: Test out this PR locally via: ```bash npm install @grafana/scenes@4.24.3--canary.759.9299159504.0 # or yarn add @grafana/scenes@4.24.3--canary.759.9299159504.0 ```
grafanabot commented 4 months ago

:rocket: PR was released in v4.24.3 :rocket: