Open zachriggle opened 3 years ago
The default behavior is very confusing at the day level... If an object is 47 hours in the future it shows up as 'in a day' instead of 'in about 2 days' or 'in a day and 23 hours'. The simplest change would be to add an option for levels of granularity. So if I say 2 levels it will do in 0 minutes 47 seconds, in a day and 3 hours, in a week and six days, and so on.
But +1 for day of week logic as an option -- "Friday at 6am" is more readily understood than "In a day and 46 hours," for example.
These are just thoughts I wanted to write down. When I have time I might be able to do some PRs on this.
I think this is a nice feature to be added to humanize. However, I think it is worth noting that we have to be able to make it work with the 60+ locales we support. Something like returning "Wednesday" instead of "in 2 days" I think can work across locales. However, some of the other suggested features/behaviours will need contributions and updates on all the locales.
Feature Request
This prints
It would be nice to be able to configure
arrow.get(...).humanize
to print something like:Similarly, it might be nice to get
"Wednesday"
instead of"in two days"
(if today is e.g. Monday) via some fiddly knob.