custom-cards / custom-card-helpers

Custom Card Helper Functions/Types for Developers
https://custom-cards.github.io/custom-card-helpers/
MIT License
48 stars 29 forks source link

Add ability to use locale.time_format #35

Closed marksie1988 closed 2 years ago

marksie1988 commented 3 years ago

The latest version introduces locale.time_format please could support be added for this?

JonahKr commented 3 years ago

i think i can take care of it in the next weeks or so

marksie1988 commented 3 years ago

Thanks, It was above my head, I'm still learning typescript but my main focus is python at the moment for work, otherwise I would have spent some time on this.

nielsfaber commented 3 years ago

I also like to see this feature added for being able to migrate my project (context: https://github.com/nielsfaber/scheduler-card/issues/322) 👍

I also don't think the HomeAssistant.locale property should be optional. This breaks a simple call like:

computeStateDisplay(hass.localize, hass.states["switch.my_switch"], hass.locale)

Due to hass.locale being "possibly undefined".

marksie1988 commented 3 years ago

yes I had the same issue when trying to implement, it was not possible with having it set as possibly undefined.

kukudemajia commented 3 years ago

Please could add ability to use locale.time_format ?

JonahKr commented 3 years ago

This isn't fully implemented yet @iantrich we should reopen this until all date and time functions got updated

iantrich commented 3 years ago

My bad. Thanks for clarifying

JonahKr commented 2 years ago

This got implemented in #50 and will be shipped with the next release 👍