Skip to content

Site Audit: trend chart groups by UTC day but labels by local day #668

Closed

Description

@gkhngyk

Problem

The hub's trend chart de-duplicates audits to one point per day using new Date(p.createdAt).toISOString().slice(0, 10) — the UTC day — while the x-axis label uses toLocaleDateString(...) — the local day. In any non-UTC timezone the two calendars disagree around midnight. Example (UTC+3): audits run at 01:00 local on two consecutive local days can fall on the same or adjacent UTC days in ways that produce two points labeled with the same date — exactly the duplicate-label situation this grouping was written to prevent. latestPoint and the delta derive from the same map, so the "latest per day" pick can also be wrong at day boundaries.

Evidence

Same bug class as the accepted #605 (UTC/local mismatch in a chart).

Fix

Build the grouping key from the same calendar as the label — local date parts (getFullYear/getMonth/getDate, or toLocaleDateString('en-CA')).

Acceptance criteria

  • One point per local day; no duplicate x-axis labels in any timezone.
  • Delta compares the latest points of two distinct local days.

Activity

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

    @BharadwajKanneveti
    Contributor

    @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