nielsfaber / scheduler-card

HA Lovelace card for control of scheduler entities
GNU General Public License v3.0
922 stars 117 forks source link

Hours showing with decimal, minutes empty in time picker #779

Open otoivanen opened 11 months ago

otoivanen commented 11 months ago

Checklist

Card Version

v3.2.12

Component Version

No response

Bug description

When adding a schedule, the time picker shows minutes as decimals in Hour -section and the minutes stay empty.

When increasing minutes from the up and down arrows, only decimals change in hours -section (and the decimals don't fit in the area if value is longer than two digits).

kuva

When googling found only one similar case which was also Finnish user. Maybe localization related?

Steps to reproduce

Not sure how to reproduce, this is how it has been since installation on Finnish setup.

Additional info

No response

otoivanen commented 11 months ago

Just noticed, that if I select the before/after sunrise mode, then minutes are showing correctly when setting the offset. Not working when giving exact time.

otoivanen commented 11 months ago

Tried also changing locale to english in Chrome, but only the character changed from comma to dot in the hour picker.

nielsfaber commented 11 months ago

Could you try setting the HA language to English and see if the issue disappears? Perhaps it is related to Finnish locale.

otoivanen commented 11 months ago

Could you try setting the HA language to English and see if the issue disappears? Perhaps it is related to Finnish locale.

Yes, I did some investogation and the reason was that HA has 00.00 time format in Finnish, but 00:00 in all other nordic countries.

I checked the card's javascript, and modified the getTimeParts function which splits on ":" - replaced it with "." and now the picker works! Just testing if scheduling also works as supposed to.

Maybe the source could be updated to split time parts also on "."?

nielsfaber commented 11 months ago

Looks like you did all the work, thanks! I was not aware of this different notation. This is definitely something that should be addressed in the code. I will put it on my to-do list.

Christoffer-da commented 6 months ago

I have the same error with Danish locale-settings.