amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
128 stars 24 forks source link

Date format #39

Closed kiwinewt closed 4 years ago

kiwinewt commented 4 years ago

Is there a way to format the date from 2020-07-22 to 22/07/2020 ?

amaximus commented 4 years ago

Date formatting is not supported yet, but I'll add some parameter to support it (for verbose_state=no of the garbage_collection sensor). If you use verbose_state=yes for the garbage_collection sensor, the garbage_collection integration has a date_format parameter: https://github.com/bruxy70/Garbage-Collection/#sensor-parameters

kiwinewt commented 4 years ago

That would be awesome. I'll have a look as well and see if it's something I can contribute if I'm not too rusty... ;)

amaximus commented 4 years ago

I recently added support for date formatting based on browser's locale. Tested with en-NZ and it displayed the date in the format you mentioned.

Please update the card, check on your side too and get back to me with results.

kiwinewt commented 4 years ago

10/10! It looks great, thank you so much