You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use utcFormat for temporal axis label comparisons (#161)
* fix: use utcFormat instead of timeFormat for temporal axis labels
The Vega-Lite labelExpr for temporal scales (date, datetime, time) was
using timeFormat() to compare axis tick values against ISO date keys
from the RENAMING clause. timeFormat formats in the browser's local
timezone, but ggsql writes all temporal data as UTC ISO strings (e.g.,
"2024-01-01" represents midnight UTC).
In non-UTC timezones, this causes every label comparison to fail. For
example, in US Central Time (UTC-6), timeFormat formats "2024-01-01"
(midnight UTC) as "2023-12-31" (6 PM local), so the comparison against
the key "2024-01-01" never matches. The labelExpr falls through to
datum.label (Vega-Lite's default formatter), which shows time-of-day
labels like "06 PM" / "07 PM" instead of the expected date labels.
The fix is to use utcFormat(), which formats in UTC and matches the
ISO date keys that ggsql generates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* cargo fmt
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments