Timelogs date filter doesn't work correctly

Summary

Timelogs report available under /-/timelogs filter is misbehaving. For example user have tracked their work on 16.10.2024 and 17.10.2024 - if you try to filter only the date 16.10.2024 it shows results even from 17.10.2024

Steps to reproduce

  1. Have some one add time spent on several issues during several days in zone GMT+2
  2. Try to filter out the middle date alone by specifing the username, From the start of, To the end of

Example Project

Link

https://gitlab.com/lthenovi/bug_test

Result in example project

image

What is the current bug behavior?

Date filter doesn't filter dates properly

What is the expected correct behavior?

When filtering date 16.10.2024 only time tracking for the 16.10.2024 day should be showed

Relevant logs and/or screenshots

When using graphql it filters the tasks correctly

{
  timelogs(username: "sotola", sort: SPENT_AT_DESC, startTime: "2024-10-16", endTime: "2024-10-16") {
    nodes {
      summary
      issue {
        name
        webUrl
      }
      timeSpent
      spentAt
      user {
        username
      }
    }
  }
}

Result

{
  "data": {
    "timelogs": {
      "nodes": [
        {
          "summary": "Školení Kaizen",
          "issue": {
            "name": "Operativa",
            "webUrl": "https://someaddress/co/it/sap/dev/administrativa/-/issues/1"
          },
          "timeSpent": 600,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        },
        {
          "summary": "žádost o služebku a registrace na event",
          "issue": {
            "name": "Operativa",
            "webUrl": "https://someaddress/co/it/sap/dev/administrativa/-/issues/1"
          },
          "timeSpent": 900,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        },
        {
          "summary": "Timetracking",
          "issue": {
            "name": "Operativa",
            "webUrl": "https://someaddress/co/it/sap/dev/administrativa/-/issues/1"
          },
          "timeSpent": 900,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        },
        {
          "summary": "import dat do měření",
          "issue": {
            "name": "SAP Digital access licence",
            "webUrl": "https://someaddress/co/it/sap/dev/bc/-/issues/1"
          },
          "timeSpent": 1800,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        },
        {
          "summary": "odstranění security issue SAP OSS, hledání možnosti updatu SAP NW 7.5",
          "issue": {
            "name": "Analýza EWA reportu za Q3/2024",
            "webUrl": "https://someaddress/co/it/sap/dev/bc/-/issues/2"
          },
          "timeSpent": 5400,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        },
        {
          "summary": "obnova SAP ROBOTA, nastavení templatu pro NDK, bug fixing",
          "issue": {
            "name": "Převedení RPA do BPA automatizace",
            "webUrl": "https://someaddress/co/it/sap/dev/sap-irpa/-/issues/6"
          },
          "timeSpent": 14400,
          "spentAt": "2024-10-15T22:00:00Z",
          "user": {
            "username": "sotola"
          }
        }
      ]
    }
  }
}

Curious is that even when you specify the date 16-10-2024 in results there are values in spentAt 2024-10-15T22:00:00Z. In my understanding when you make time tracking it takes the timestamp of that day 2024-10-16T00:00:00Z and then substracts time zone difference to 2024-10-15T22:00:00Z - maybe this is something that the timelogs filter doesn't handle correctly, but GrapQl does.

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info
System information System: Current User: git Using RVM: no Ruby Version: 3.1.5p253 Gem Version: 3.5.17 Bundler Version:2.5.11 Rake Version: 13.0.6 Redis Version: 7.0.15 Sidekiq Version:7.2.4 Go Version: go1.21.13 (Red Hat 1.21.13-4.el9_4) linux/amd64 GitLab information Version: 17.4.2 Revision: 2c7e66ebdb6 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 14.11 URL: https://gitlab.aed.pce.cz.pan.eu HTTP Clone URL: https://gitlab.aed.pce.cz.pan.eu/some-group/some-project.git SSH Clone URL: git@gitlab.aed.pce.cz.pan.eu:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: saml GitLab Shell Version: 14.39.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Gitaly - default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket - default Version: 17.4.2 - default Git Version: 2.46.0

Results of GitLab application Check

Expand for output related to the GitLab application check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version \>= 14.39.0 ? ... OK (14.39.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Checking Reply by email ...

Mailroom enabled? ... skipped MailRoom running? ... skipped

Checking Reply by email ... Finished

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 2/1 ... yes 10/2 ... yes 10/3 ... yes 10/5 ... yes 10/6 ... yes 10/8 ... yes 10/9 ... yes 10/10 ... yes 10/11 ... yes 10/12 ... yes 10/13 ... yes 32/14 ... yes 10/15 ... yes 10/16 ... yes 10/17 ... yes 10/18 ... yes 10/19 ... yes 10/20 ... yes 10/21 ... yes 10/22 ... yes 10/23 ... yes 8/24 ... yes 10/25 ... yes 57/27 ... yes 10/28 ... yes 10/29 ... yes 57/30 ... yes 10/31 ... yes 8/32 ... yes 43/34 ... yes 43/35 ... yes 77/36 ... yes 82/37 ... yes 43/38 ... yes 43/39 ... yes 43/40 ... yes 43/41 ... yes 43/42 ... yes 43/43 ... yes 44/44 ... yes 43/45 ... yes 44/46 ... yes 43/47 ... yes 44/48 ... yes 44/49 ... yes 44/50 ... yes 43/51 ... yes 44/52 ... yes 43/53 ... yes 43/54 ... yes 43/55 ... yes 43/56 ... yes 43/57 ... yes 10/59 ... yes 81/62 ... yes 8/63 ... yes 116/64 ... yes 116/65 ... yes 116/66 ... yes 116/67 ... yes 116/68 ... yes 116/69 ... yes 116/70 ... yes 116/71 ... yes 116/72 ... yes 116/74 ... yes 116/75 ... yes 116/76 ... yes 116/78 ... yes 116/79 ... yes 116/80 ... yes 116/81 ... yes 116/82 ... yes 116/83 ... yes 116/84 ... yes 116/85 ... yes 117/86 ... yes 117/87 ... yes 117/88 ... yes 117/90 ... yes 117/91 ... yes 117/92 ... yes 117/93 ... yes 117/94 ... yes 117/95 ... yes 117/96 ... yes 117/97 ... yes 115/98 ... yes 115/99 ... yes 115/100 ... yes 113/101 ... yes 113/102 ... yes 113/103 ... yes 113/104 ... yes 113/105 ... yes 113/106 ... yes 113/107 ... yes 113/108 ... yes 113/109 ... yes 113/110 ... yes 113/111 ... yes 113/112 ... yes 113/113 ... yes 113/114 ... yes 113/115 ... yes 113/116 ... yes 113/117 ... yes 113/118 ... yes 113/119 ... yes 113/120 ... yes 113/121 ... yes 113/122 ... yes 113/123 ... yes 113/124 ... yes 113/125 ... yes 113/126 ... yes 113/127 ... yes 113/128 ... yes 113/129 ... yes 113/130 ... yes 113/131 ... yes 113/132 ... yes 113/133 ... yes 113/134 ... yes 113/135 ... yes 113/136 ... yes 113/137 ... yes 113/138 ... yes 113/139 ... yes 113/140 ... yes 113/141 ... yes 113/142 ... yes 113/143 ... yes 113/144 ... yes 113/145 ... yes 113/146 ... yes 113/147 ... yes 113/148 ... yes 113/149 ... yes 113/150 ... yes 113/151 ... yes 113/152 ... yes 113/153 ... yes 113/154 ... yes 113/155 ... yes 113/156 ... yes 113/157 ... yes 113/158 ... yes 113/159 ... yes 113/160 ... yes 113/161 ... yes 113/162 ... yes 113/163 ... yes 113/164 ... yes 113/165 ... yes 113/166 ... yes 113/167 ... yes 113/168 ... yes 113/169 ... yes 113/170 ... yes 113/171 ... yes 113/172 ... yes 113/173 ... yes 113/174 ... yes 113/175 ... yes 113/176 ... yes 113/177 ... yes 113/178 ... yes 113/179 ... yes 113/180 ... yes 113/181 ... yes 113/182 ... yes 113/183 ... yes 113/184 ... yes 113/185 ... yes 113/186 ... yes 113/187 ... yes 113/188 ... yes 113/189 ... yes 113/190 ... yes 113/191 ... yes 113/192 ... yes 113/193 ... yes 113/194 ... yes 113/195 ... yes 113/196 ... yes 113/197 ... yes 113/198 ... yes 113/199 ... yes 113/200 ... yes 113/201 ... yes 113/202 ... yes 113/203 ... yes 113/204 ... yes 113/205 ... yes 113/206 ... yes 113/207 ... yes 113/209 ... yes 113/210 ... yes 113/211 ... yes 113/212 ... yes 113/213 ... yes 113/214 ... yes 113/216 ... yes 113/217 ... yes 113/218 ... yes 113/219 ... yes 113/220 ... yes 113/221 ... yes 113/222 ... yes 113/223 ... yes 113/224 ... yes 113/225 ... yes 113/226 ... yes 113/227 ... yes 8/228 ... yes 43/229 ... yes 43/230 ... yes 43/231 ... yes 43/232 ... yes 44/233 ... yes 117/234 ... yes 32/235 ... yes 10/236 ... yes 43/237 ... yes 113/238 ... yes 43/239 ... yes 10/240 ... yes 113/241 ... yes 113/242 ... yes 117/243 ... yes 44/244 ... yes 116/245 ... yes 43/246 ... yes 44/247 ... yes 43/249 ... yes 44/251 ... yes 44/253 ... yes 116/254 ... yes 43/255 ... yes 8/256 ... yes 44/257 ... yes 10/258 ... yes 8/259 ... yes 330/261 ... yes 332/262 ... yes 332/263 ... yes 343/264 ... yes 10/265 ... yes 18/266 ... yes 348/268 ... yes 350/269 ... yes 117/270 ... yes 81/271 ... yes 8/272 ... yes 81/273 ... yes 81/274 ... yes 43/275 ... yes 10/276 ... yes 362/277 ... yes 16/278 ... yes 10/279 ... yes 116/280 ... yes 362/281 ... yes 117/282 ... yes 370/283 ... yes 362/284 ... yes 10/285 ... yes 4/286 ... yes 362/287 ... yes 8/288 ... yes 43/289 ... yes 113/290 ... yes 10/291 ... yes 10/295 ... yes 10/296 ... yes 362/297 ... yes 44/298 ... yes 350/299 ... yes 43/300 ... yes 113/301 ... yes 10/302 ... yes Redis version \>= 6.2.14? ... yes Ruby version \>= 3.0.6 ? ... yes (3.1.5) Git user has default SSH configuration? ... yes Active users: ... 42 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

@gitlab-bot label time tracking
@gitlab-bot label typebug

Edited by Lukáš Novák