Skip to content

Heatmap: Actions are shown on the previous day #6087

Closed
@siddweiker

Description

@siddweiker
Contributor
  • Gitea version (or commit ref): dfad569 1.7.1 (docker image)
  • Git version: 2.18.1
  • Operating system: Alpine Linux 3.8 (docker image)
  • Database:
    • PostgreSQL
      MySQL
      MSSQL
      SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (screenshots below)
      No
      Not relevant
  • Log gist: none

Description

Heatmap actions are shown on the previous day for actions in an EST (and beyond?) timezone.

Steps to reproduce:

  • Have your system time be in EST
  • Register and login to https://try.gitea.io
  • Create a repository and make a commit
  • View the heatmap and compare the date of the 2 actions that should be there

Screenshots

Here is a screenshot from my own gitea instance, the heatmap should show actions from Monday to Friday, instead they are shifted back one day.
image

From try.gitea.io, here is a combined screenshot to show the commit time and the heatmap action time:
image

Activity

troygeiger

troygeiger commented on Mar 5, 2019

@troygeiger

I noticed this today as well.

Jamozed

Jamozed commented on Mar 30, 2019

@Jamozed

NZST timezone (UTC +12:00/13:00) also does this, except only before midday.

kolaente

kolaente commented on Apr 9, 2019

@kolaente
Member

This probably has to do with the fact the server runs in a different timezone (most likely utc) than your browser.

Jamozed

Jamozed commented on Apr 10, 2019

@Jamozed

This probably has to do with the fact the server runs in a different timezone (most likely utc) than your browser.

This was the first thing I checked in my case, my server and browser are absolutely running in the same timezone.

siddweiker

siddweiker commented on Apr 10, 2019

@siddweiker
ContributorAuthor

I think its because the time is striped from the timestamp.

groupBy = "strftime('%s', strftime('%Y-%m-%d', created_unix, 'unixepoch'))"

stale

stale commented on Jun 9, 2019

@stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

added
issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implemented
on Jun 10, 2019
Brayyy

Brayyy commented on Dec 29, 2020

@Brayyy

This issue is still present on 1.14.0+dev-394-g069acf6a2.

It is caused by a disparity in the timezone of the DB (MySQL in my case), and the local browser. My company mainly works out of the EDT timezone, but I am in PST (three hours behind). When I push code, I always see it appear on the prior day, however, if I adjust my local system time to be EDT, the blocks align correctly.

As noted, the issue is rooted in the DB query roundingcreated_unix down to the local day, then in the browser, JS applies the TZ offset, and then rounds this value down a second time, which is now the prior day.

The best solution would likely be to read the timezone from the user browser and use that when globbing the created_unix hours into a single day.

Colin5887

Colin5887 commented on Jan 9, 2021

@Colin5887

@Brayyy

I think there are two problems: incorrect heatmap and incorrect commission time.

The commission time (the text popup when hovering on the "19 hours ago") can be changed by putting a time section in the setting. Everyone who accesses that gitea server will use the same time zone.

However, the heatmap uses UTC+0 time zone and there is currently no way to change that. I live in AEDT (UTC+10) and every commission before 10:00 will be marked as yesterday's work.

17 remaining items

Loading
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

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @lafriks@siddweiker@Brayyy@kolaente@troygeiger

      Issue actions

        Heatmap: Actions are shown on the previous day · Issue #6087 · go-gitea/gitea