Skip to content

Streak resets to 0 in the evening for UTC-negative timezone users due to "today" being calculated in UTC #884

@Animesh352

Description

@Animesh352

Bug
Using on a GitHub readme page-
The widget determines "today" using the current UTC date. For users in UTC-negative timezones (e.g. EST = UTC-5), this means from 7:00pm EST onward, the widget's "today" has already rolled over to the next calendar date. Since the user hasn't made any commits for that future UTC date yet, the streak displays as 0 — even though locally it is still the same day and the streak should be intact.
Expected: "Today" should be evaluated in the user's local timezone, so the streak is only assessed at midnight local time.
Actual: "Today" is evaluated in UTC, causing false streak resets every evening for users west of UTC.
To reproduce:

To Reproduce
Be in EST (UTC-5) or any UTC-negative timezone
Make commits earlier in the day
After the time when UTC is on the next day, but your timezone is still the previous day, check the streak widget — streak shows 0, and the current date shown is tomorrow's local date

Desktop:

  • OS: MacOS
  • Browser: Chrome
  • Version: Version 145

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions