mtierltd / timetracker

GNU Affero General Public License v3.0
83 stars 29 forks source link

Timer page showing incorrect date heading #123

Closed lowellfriesen closed 3 years ago

lowellfriesen commented 3 years ago

Hi there. Thanks for developing this app for Nextcloud.

I'm experiencing an issue where there is a discrepancy between the date and time indicated on task(s) with the date heading on the Timer page of the app. E.g., if I enter a task for 7-8PM on July 11th, the task shows up on the Timer page under the heading "Mon, 12 Jul." The task seems to be associated with the correct date everywhere else, it's just that it doesn't show up under the heading "Sun, 11 Jul" on the Timer page.

The timezone and locale info. in the app are correct for my timezone. It's possible that the issue is a result of incorrect timezone info. on the server my Nextcloud instance runs on. I noticed this issue when I was attempting to troubleshoot the problem myself. I changed the timezone on the server to the correct one, but this doesn't seem to have changed the way the Timer page associates tasks to dates. I even uninstalled and reinstalled the Timer Tracker app, but this too do not solve the issue.

mtierltd commented 3 years ago

Hi

5a0d2457a1b56a429a02e8a2ed08ca68d10c0a23 implements better locale handling, so please go ahead and test it.

Thank you

jimtjames commented 3 years ago

I'm unfortunately still seeing this behavior (I've fully updated the app). I have a feeling that it's actually in the PHP, not the JS.

I'm not very familiar with PHP, but here's my guess as to the line in question.

https://github.com/mtierltd/timetracker/blob/7f83559d456a9dcd3d8a0888b128815e31f64233/lib/Controller/AjaxController.php#L87

I see in other parts of this file, the default time zone is set to UTC. When the day is parsed, it seems to only takes in the start time of the working item instead of accounting for the timezone shift. As such, the reported day might be the day given assuming the timestamp is UTC time.

Could you perhaps take a look at this? I'm not super familiar with the codebase, so it's very possible that I'm wrong here.

Thanks!

mtierltd commented 3 years ago

Did you update the app from the nextcloud app store or are you running the git version?

mtierltd commented 3 years ago

@jimtjames please try commit 870c74a058b7155e3af2c03552f349674299aebe

jimtjames commented 3 years ago

Just tried the latest update and it seems to be working now! Thank you.

lowellfriesen commented 3 years ago

Yes, the latest update appears to have solved the problem for me as well.  Thank you.

On 2021-07-23 8:09 p.m., Jim James wrote:

Just tried the latest update and it seems to be working now! Thank you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mtierltd/timetracker/issues/123#issuecomment-885980106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUFV5WXLWO7NNFJ63VN7LLLTZIHFVANCNFSM5AHMXSPQ.