Format timestamp sensor states (#10525)

This commit is contained in:
Bram Kragten 2021-11-05 12:01:14 +01:00 committed by GitHub
parent ea331dbe0b
commit c26a59d805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,7 +117,10 @@ export const computeStateDisplay = (
}
// state of button is a timestamp
if (domain === "button") {
if (
domain === "button" ||
(domain === "sensor" && stateObj.attributes.device_class === "timestamp")
) {
return formatDateTime(new Date(compareState), locale);
}