Skip to content

AI Traffic: trend chart shows the wrong day in negative-UTC timezones; tooltip prints raw ISO dates #605

Closed

Description

@gkhngyk

Problem

The AI Traffic trend chart buckets visits by UTC day on the server, but the X-axis formatter parses the "YYYY-MM-DD" bucket key with new Date(v) — which is UTC midnight — and renders it in the browser's local timezone. In any negative-UTC-offset timezone (all of the Americas), every label shifts one day back: the Aug 1 bucket displays as "Jul 31".

Two smaller issues in the same spot: the custom tooltip doesn't format the label at all (it prints the raw 2026-08-01 next to an axis that says "Aug 1"), and the formatter hardcodes the 'en' locale while sibling pages pass undefined to use the viewer's locale.

Reproduction

TZ=America/Los_Angeles node -e "console.log(new Date('2026-08-01').toLocaleDateString('en',{month:'short',day:'numeric'}))" → Jul 31

Evidence

Suggested fix

Format the bucket key with timeZone: 'UTC' so the label names the bucket's own day, e.g. d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', timeZone: 'UTC' }), extract that into a small helper, and reuse it for the tooltip label.

Acceptance criteria

  • In a US timezone, a visit bucketed under Aug 1 appears under an "Aug 1" tick.
  • The tooltip shows the same formatted date as the axis, not a raw ISO string.

Activity

  1. added
    bug
    good first issue
    on Aug 3, 2026
  2. BharadwajKanneveti commented on Aug 3, 2026

    @BharadwajKanneveti
    Contributor

    Hi @gkhngyk I will work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions