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

Consider using diffForHumans instead of diffInRealMinutes in the welcome message #56

Closed
moisesh18 opened this issue Dec 29, 2024 · 1 comment

Comments

@moisesh18
Copy link

moisesh18 commented Dec 29, 2024

Hello,

I’ve noticed a small issue regarding the use of diffInRealMinutes in the welcome message. Currently, the code uses:
->line(Lang::get('This welcome link will expire in :count minutes.', ['count' => $this->validUntil->diffInRealMinutes()]));

The diffInRealMinutes function does not handle formatting user-friendly time differences (e.g., “in 5 minutes”, “in 2 hours”) and might return unexpected negative or non-rounded values.

To improve the user experience, I recommend replacing diffInRealMinutes with diffForHumans, which provides a more readable and accurate representation of the remaining time. For example:
->line(Lang::get('This welcome link will expire :time.', ['time' => $this->validUntil->diffForHumans()]));

@moisesh18 moisesh18 changed the title diffInRealMinutes does not round correctly in the welcome message Consider using diffForHumans instead of diffInRealMinutes in the welcome message Dec 29, 2024
@moisesh18
Copy link
Author

#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants