scheduler-card icon indicating copy to clipboard operation
scheduler-card copied to clipboard

Hours showing with decimal, minutes empty in time picker

Open otoivanen opened this issue 1 year ago • 6 comments

Checklist

  • [X] I checked for similar existing issues (both open and closed) before posting.
  • [X] I will participate in further discussion about this issue and can help by testing (if requested).

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 avatar Dec 26 '23 17:12 otoivanen

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 avatar Dec 26 '23 18:12 otoivanen

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

otoivanen avatar Dec 26 '23 18:12 otoivanen

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

nielsfaber avatar Dec 26 '23 18:12 nielsfaber

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

otoivanen avatar Dec 26 '23 18:12 otoivanen

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.

nielsfaber avatar Dec 26 '23 18:12 nielsfaber

I have the same error with Danish locale-settings.

Christoffer-da avatar May 15 '24 08:05 Christoffer-da