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

Improve calculation of the time since depositing on the Transactions list. #864

Closed
michalinacienciala opened this issue Nov 14, 2024 · 1 comment · Fixed by #869
Closed
Assignees
Labels
🐛 Bug Something isn't working 🎨 dApp dApp

Comments

@michalinacienciala
Copy link
Contributor

michalinacienciala commented Nov 14, 2024

I'm not a fan of how the duration since depositing is displayed in the counter on the Transaction list. If a deposit was made at 12:00 and it's now 12:59 the counter shows the deposit was made 59 minutes ago. But if it's 13:01, the counter shows that the deposit was made 2 hours ago.

image

I think we should round the values down rather than up. @SorinQ agrees.

So the counter would be expected to work this way:

59 s
1 min
2 min
31 min
59 min
1 hour (60 - 119 min)
2 hours (120 - 179 min)
Etc.

I haven't checked yet how the counter works for withdrawals, but I assume it works the same and should be updated as well.

Tested in LL on the preview of #860.

@michalinacienciala michalinacienciala added 🐛 Bug Something isn't working 🎨 dApp dApp labels Nov 14, 2024
Copy link

linear bot commented Nov 14, 2024

@nkuba nkuba added this to the Ledger Live Launch milestone Nov 15, 2024
@kkosiorowska kkosiorowska self-assigned this Nov 15, 2024
michalinacienciala added a commit that referenced this issue Nov 18, 2024
Closes #864
Closes #196

Some time ago we discussed the use of an external library to show
relative time. So let's use
[luxon](https://moment.github.io/luxon/api-docs/index.html#datetimetorelative)
to solve the problem described in
#864.

> If a deposit was made at 12:00 and it's now 12:59 the counter shows
the deposit was made 59 minutes ago. But if it's 13:01, the counter
shows that the deposit was made 2 hours ago.

This problem does not exist with the external library.

https://deploy-preview-869--acre-dapp-testnet.netlify.app/dashboard
![Screenshot 2024-11-15 at 15 33
42](https://github.com/user-attachments/assets/3eea77d5-1a8f-4180-b7d6-dfdd73886d38)


https://bitcoin.test.acre.fi/dashboard

![Screenshot 2024-11-15 at 15 33
49](https://github.com/user-attachments/assets/2d69044c-b24e-4a86-9548-e6160bad2047)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 🎨 dApp dApp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants