# Code dans custom:button-card

**URL:** <https://forum.hacf.fr/t/code-dans-custom-button-card/29632>\
**Category:** Entraide Home Assistant\
**Tags:** card\
**Created:** [Octobre 20, 2023, 1:15 UTC](https://forum.hacf.fr/t/code-dans-custom-button-card/29632 "2023-10-20T13:15:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![WarC0zes](https://forum.hacf.fr/user_avatar/forum.hacf.fr/warc0zes/32/137471_2.png) [@WarC0zes](https://forum.hacf.fr/u/WarC0zes)\
**Post date:** [Octobre 20, 2023, 4:38 UTC](https://forum.hacf.fr/t/code-dans-custom-button-card/29632/4 "2023-10-20T16:38:40Z")

</div>

Voila comment faire:

 ![format button-card](https://forum.hacf.fr/uploads/default/original/3X/0/2/02cd95163b7764b708dd6a977d5c3acd1f707f61.png)

```auto
type: custom:button-card
entity: input_datetime.time
show_name: false
show_state: true
show_label: true
state_display: |
  [[[return 'Ce soir à ' + helpers.formatTime24h(states['input_datetime.time'].state); ]]]

```

sans format:

 ![format button-card2](https://forum.hacf.fr/uploads/default/original/3X/4/8/488bbd8f4cee70ce8daf8b38fa4c4dc25e7baa75.png)

Y avait déja un sujet dessus [Button-card - comment afficher un attribut date "formaté"?](https://forum.hacf.fr/t/button-card-comment-afficher-un-attribut-date-formate/26515)

---

_[View the full topic](https://forum.hacf.fr/t/code-dans-custom-button-card/29632)._
