Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity page: commit day labels before yesterday seem to be one day off #1248

Closed
nimmerland opened this issue Jul 17, 2017 · 2 comments
Closed

Comments

@nimmerland
Copy link

gitblit 1.8.0 GO, on win7, java8, firefox 54.0.1,
language setting DE (EN also tested and used for screenshots)

Hi,

on the activity page that shows the latest number of commits are labels for grouping the commits by day (like today, yesterday). For today and yesterday those labels are correct.

But right after yesterday shows a label '3 days ago' which has commits from 2 days ago. The tooltip for the commit time label however does correctly show '2 days ago':
gitblit180_daylabels_activitypage_wrong2 gitblit180_daylabels_activitypage_wrong

On the my dashboard page the same commits are also shown correctly as '2 days ago'.
gitblit180_daylabels_mydashboard_correct

Thanks for everyones efforts on gitblit.

@AmishP
Copy link

AmishP commented Jul 20, 2018

I have seen the same on my install. I know this is a year old but I can look into fixing it. But I noticed there has not been any updates in the last 2 years.

@flaix
Copy link
Member

flaix commented Oct 17, 2021

As usual with time and date related problems, this is a rather tricky one.
For one, it could be simply time zones being disregarded in calculations, or it could be wrong rounding in the daysAgo method.
Then, the TimeUtil methods are used in various places where a time difference is displayed in the UI. Without checking where what is needed, fixing anything could break other places.
In any case, any fix can only be a temporary band aid. I think the whole time handling needs to be rewritten once Gitblit switches to Java 8.

@flaix flaix added this to the 1.9.2 milestone Oct 19, 2021
flaix added a commit to flaix/gitblit that referenced this issue Oct 23, 2021
Add tests for `timeAgo` to analyse issue gitblit-org#1248.
The tests are dependent on when they run as they time functions use the
current date and time. To make them testable in a reproducible way, we
need the ability to pass in what we think is "now". So add overloaded
methods that take a `now` parameter so that we can pass in the current
time.
@flaix flaix closed this as completed in 920fc52 Oct 23, 2021
@flaix flaix added Status-Fixed and removed Priority-Low Status-Verified A bug could be reproduced. labels Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants