Fix ha-relative-time usage for tags and sun (#7944)

This commit is contained in:
Philip Allgaier 2020-12-12 20:46:56 +01:00 committed by GitHub
parent 8a42e65c6a
commit 4930532c7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ import type { HomeAssistant } from "../types";
class HaRelativeTime extends UpdatingElement {
@property({ attribute: false }) public hass!: HomeAssistant;
@property({ attribute: false }) public datetime?: string;
@property({ attribute: false }) public datetime?: string | Date;
private _interval?: number;

View File

@ -44,7 +44,7 @@ class MoreInfoSun extends LitElement {
>
<ha-relative-time
.hass=${this.hass}
.datetimeObj=${item === "ris" ? risingDate : settingDate}
.datetime=${item === "ris" ? risingDate : settingDate}
></ha-relative-time>
</div>
<div class="value">

View File

@ -84,7 +84,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
${tag.last_scanned_datetime
? html`<ha-relative-time
.hass=${this.hass}
.datetimeObj=${tag.last_scanned_datetime}
.datetime=${tag.last_scanned_datetime}
></ha-relative-time>`
: this.hass.localize("ui.panel.config.tags.never_scanned")}
</div>`
@ -103,7 +103,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
${last_scanned_datetime
? html`<ha-relative-time
.hass=${this.hass}
.datetimeObj=${last_scanned_datetime}
.datetime=${last_scanned_datetime}
></ha-relative-time>`
: this.hass.localize("ui.panel.config.tags.never_scanned")}
`,