diff --git a/dist/meteofrance-weather-card.js b/dist/meteofrance-weather-card.js index c13d53d..bea8179 100755 --- a/dist/meteofrance-weather-card.js +++ b/dist/meteofrance-weather-card.js @@ -420,6 +420,7 @@ class MeteofranceWeatherCard extends LitElement { next_rising = new Date(sun.attributes.next_rising); next_setting = new Date(sun.attributes.next_setting); } + const hour12 = this.hass.locale.time_format == "12" ? true : this.hass.locale.time_format == "24" ? false : undefined; this.numberElements++; @@ -473,7 +474,9 @@ class MeteofranceWeatherCard extends LitElement { ${next_rising ? this.renderDetail( - next_rising.toLocaleTimeString(), + next_setting.toLocaleTimeString([], { + hour12: hour12, + }), "Heure de lever", "mdi:weather-sunset-up" ) @@ -481,7 +484,9 @@ class MeteofranceWeatherCard extends LitElement { ${next_setting ? this.renderDetail( - next_setting.toLocaleTimeString(), + next_setting.toLocaleTimeString([], { + hour12: hour12, + }), "Heure de coucher", "mdi:weather-sunset-down" ) @@ -585,6 +590,7 @@ class MeteofranceWeatherCard extends LitElement { const lang = this.hass.selectedLanguage || this.hass.language; const isDaily = forecast.type === "daily" ; + const hour12 = this.hass.locale.time_format == "12" ? true : this.hass.locale.time_format == "24" ? false : undefined; this.numberElements++; return html`