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

Time is rounded differently #145

Closed
cyberalien opened this issue Nov 26, 2022 · 8 comments · Fixed by #444
Closed

Time is rounded differently #145

cyberalien opened this issue Nov 26, 2022 · 8 comments · Fixed by #444
Labels
c: bug Something isn't working p: 1-normal Nothing urgent

Comments

@cyberalien
Copy link
Member

cyberalien commented Nov 26, 2022

There is a difference in rounding time in notifications in Mastodon and Elk.

Example post:

  • Created at 12:48
  • Boosted at 21:24

Difference is 8:36

In top right corner of notification Elk shows "9h", Mastodon shows "8h".

I think Mastodon's approach of rounding down is better. 9 hours haven't passed.

edit: actually, boosted time is irrelevant. It uses current time. Still 9 hours haven't passed yet since post as it is currently 21:30.

@patak-dev patak-dev added the c: bug Something isn't working label Nov 26, 2022
@cyberalien
Copy link
Member Author

Same issue with posts on home page. Post made 51 minutes ago shows as "1h" in Elk.

@cyberalien
Copy link
Member Author

cyberalien commented Nov 26, 2022

Probably same issue, so I'll post it here.

Post time: "26 November 2022 at 00:08:16" (also Mastodon doesn't show seconds in tooltip, Elk does)
Current time: 26 Nov, 22:51

Elk shows it as "yesterday". Mastodon correctly shows "22h".

@Shinigami92 Shinigami92 added the p: 1-normal Nothing urgent label Nov 28, 2022
@userquin
Copy link
Member

@cyberalien can you check it again? I'm checking on home page and it seems to be correct.

@cyberalien
Copy link
Member Author

Still bugged.

  • Post made 5 days 23 hours 20 mins ago shows as "5d" in Mastodon, "6d" in Elk.
  • Post made 2 hours 51 minutes ago shows as "2h" in Mastodon, "3h" in Elk.

@userquin
Copy link
Member

@cyberalien the problem is the round usage here https://github.com/vueuse/vueuse/blob/main/packages/core/useTimeAgo/index.ts#L163 , it should be a floor or make it configurable.

I'll send a PR to vue use...

@userquin
Copy link
Member

userquin commented Dec 14, 2022

@cyberalien PR sent: vueuse/vueuse#2543 (once feat released we need to configure floor)

/cc @antfu

@userquin
Copy link
Member

userquin commented Dec 14, 2022

Testing changing useTimeAgo using floor (I'll check it again in 30 minutes...):

imagen

@userquin
Copy link
Member

It took a few seconds to switch to 2h:

imagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working p: 1-normal Nothing urgent
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants