TheFes / relative-time-plus

Relative Time Macro with additional options
Creative Commons Zero v1.0 Universal
26 stars 12 forks source link

Failing to render 1 part, when parts is set to 2 #60

Open brechtvhb opened 23 hours ago

brechtvhb commented 23 hours ago

When I use this code

relative_time_plus(as_local(as_datetime(states('sensor.my2024_time_to_full_charge'))), parts=2, round_mode="common",not_use=["second", "millisecond"]) }}

this works fine for intervals larger than 1 hour, but once it falls below one hour it shows 0 minutes instead of ,for example, 55 minutes

brechtvhb commented 23 hours ago

Correction! Works fine with for example an interval of 55 minutes. It does not seem to work for an interval of 59 minutes and 50 seconds. Code then seems to round up to 1 hour, but shows 0 minutes instead of 1 hour.

TheFes commented 21 hours ago

Thanks for letting me know, I will look into it