GeorgeSG / lovelace-time-picker-card

🕰️ Time Picker Card for Home Assistant's Lovelace UI
MIT License
209 stars 14 forks source link

minute_step, round to the nearest time without remainder #16

Open andreypolyak opened 3 years ago

andreypolyak commented 3 years ago

First of all thank you for the great card!

Problem

Suggested feature / solution

Currently if I have for example 15:24 as a time and minute_step=15 in the config, if I press "ᐱ" button it will change time to 15:39, then to 15:54, 16:09, etc. Instead as an option I'd like to have it first changed to 15:30, then to to 15:45, 16:00, etc. So to have after each interaction minutes without remainder.

Additional context

GeorgeSG commented 3 years ago

I don't have a lot of time to work on the card for now, but I like the idea.

In case anyone wants to give it a try and open a PR, here's how I would go about it briefly:

Be mindful of Minute.willOverflow and Second.willOverflow.