-
Notifications
You must be signed in to change notification settings - Fork 721
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
Feature request: toRelative multiple units #579
Comments
Indeed sounds useful. Have you tried specifying no unit at all? In that case, the method picks the 'best' unit (i.e. largest non zero unit), which should indeed return |
Yes, I've tried but it always falls back to date or |
From the unit tests :
What you describe looks more like |
why does |
The difference between these two methods is that |
I opened a PR at #926 to implement this. |
* feat: multiple units support in toRelative closes #579 * add two more tests
It would be great to specify multiple units for
toRelative()
to receive a more precise result if the date is less than 24 hours.toRelative({ units: ['days', 'hours' ]})
The text was updated successfully, but these errors were encountered: