Petro31 / easy-time-jinja

Easy Time calculations for Home Assistant templates
MIT License
73 stars 25 forks source link

[Feature Request] Version of Easy Relative Time with Rounding #21

Closed Californian closed 11 months ago

Californian commented 11 months ago

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".

Petro31 commented 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.

Californian commented 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.

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:

Petro31 commented 11 months ago

2.0.0