Closed Californian closed 11 months ago
easy_relative_time already does this unless you specify otherwise. It only provides hours and minutes if you request it, otherwise it outputs the most relevant relative time.
easy_relative_time already does this unless you specify otherwise. It only provides hours and minutes if you request it, otherwise it outputs the most relevant relative time.
When I have a value that's in 1 hour 59 minutes, easy_relative_time
outputs "1 hour". I'm suggesting a function that would, instead, output "2 hours" for anything greater than or equal to 1 hour 30 minutes.
Test template:
easy_relative_time(now() + timedelta( hours = 1, minutes = 59 ))
shows 1 hour
.easy_rounded_relative_time(now() + timedelta( hours = 1, minutes = 59 ))
would show 2 hours
.2.0.0
I'd love to use a version of "easy_relative_time" ("easy_rounded_relative_time"?) where, if it's at e.g. 2 hours 59 minutes, it rounds to 3 hours and outputs "~3 hours".