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

Day ago count is wrong in issue comments #1906

Closed
2 tasks done
gayprogrammer opened this issue Jun 7, 2017 · 11 comments
Closed
2 tasks done

Day ago count is wrong in issue comments #1906

gayprogrammer opened this issue Jun 7, 2017 · 11 comments
Labels
issue/stale type/enhancement An improvement of existing functionality

Comments

@gayprogrammer
Copy link

gayprogrammer commented Jun 7, 2017

Today is Wednesday June 7 (19:21:25 UTC). The test issue in the above linked issue was created on Monday June 5 and was closed on Tuesday June 6. Here is what is displayed:

razzintown commented 1 day ago (Mon, 05 Jun 2017 23:52:30 UTC)
gitpitch closed 1 day ago (Tue, 06 Jun 2017 03:26:36 UTC)

Since 7 - 5 = 2 It should read 2 days ago for the number of days ago it was created.

I also suggest that 1 day ago should actually read yesterday.

@sondr3
Copy link
Contributor

sondr3 commented Jun 7, 2017

You could also use a JS library to automatically and dynamically change the time, e.g. timeago.js. The aforementioned library also includes translations if that's something.

This is just throwing it out there, I see that you do this when pages are requested in Gitea. GitHub uses JS as well to automatically change datetime elements to their correct date. I also disagree with 1 day ago becoming yesterday, I'd much rather it becomes a day ago instead.

@gayprogrammer
Copy link
Author

gayprogrammer commented Jun 8, 2017

Note that at this moment, the test issue linked above is showing the days ago correctly. There may be only a short span of time where this bug shows itself, or a certain time of day.
UPDATE: Yes, the bug in the test issue linked above appears every day.

@sondr3 I agree that using a JS library might be a better solution than having it done on the server. I am also perfectly fine with the phrase a day ago.

@lunny
Copy link
Member

lunny commented Jun 8, 2017

yesterday means we need a new translation item. :)

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jun 8, 2017
@gayprogrammer
Copy link
Author

gayprogrammer commented Jun 8, 2017

@lunny This is a bug. (See https://try.gitea.io/gitpitch/code-presenting/issues/1)

razzintown commented 1 day ago (Mon, 05 Jun 2017 23:52:30 UTC)
gitpitch closed 1 day ago (Tue, 06 Jun 2017 03:26:36 UTC)

Monday and Tuesday are not both 1 day ago .

@lunny lunny added type/bug and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jun 9, 2017
@lunny lunny added this to the 1.x.x milestone Jun 9, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jun 11, 2017

No it's not a bug...

now       (07 Jun 2017 19:21:25 UTC)
1 day ago (05 Jun 2017 23:52:30 UTC)
1 day ago (06 Jun 2017 03:26:36 UTC)

6th 03:26 => 7th 19:21 == 1 day, 15h 55m
5th 23:52 => 7th 19:21 == 1 day, 19h 29m

So 1 day is technically more correct than 2 days :)

@bkcsoft bkcsoft added type/enhancement An improvement of existing functionality and removed type/bug labels Jun 11, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jun 11, 2017

It would however be an enhancement. But it would be very hard to do correctly... Don't want 5 minutes to show up as "1 day" (5th 23:58 => 6th 00:03)

@leitzler
Copy link
Contributor

Wouldn't it be good start with:
< 1 minute gives "x seconds ago"
< 1 hour gives "x minutes ago"
< 24 hours "x hours ago"
And leave the rest as is, or change them to calculate number of midnights passed in browser timezone.

@sondr3
Copy link
Contributor

sondr3 commented Jun 12, 2017

Which is more or less what the JS libraries do.

@bkcsoft
Copy link
Member

bkcsoft commented Jun 15, 2017

I agree that we should use an existing JS-lib for this. Just keep the license in mind 😉

@stale
Copy link

stale bot commented Feb 14, 2019

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.

@stale stale bot added the issue/stale label Feb 14, 2019
@stale
Copy link

stale bot commented Feb 28, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed Feb 28, 2019
@lafriks lafriks removed this from the 1.x.x milestone Mar 2, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

6 participants