mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 05:16:34 +00:00
Adjust tags just scanned time display (#6663)
This commit is contained in:
parent
294665fbe8
commit
bc4c9cc40d
@ -21,6 +21,11 @@ export default function relativeTime(
|
|||||||
const tense = delta >= 0 ? "past" : "future";
|
const tense = delta >= 0 ? "past" : "future";
|
||||||
delta = Math.abs(delta);
|
delta = Math.abs(delta);
|
||||||
let roundedDelta = Math.round(delta);
|
let roundedDelta = Math.round(delta);
|
||||||
|
|
||||||
|
if (roundedDelta === 0) {
|
||||||
|
return localize("ui.components.relative_time.just_now");
|
||||||
|
}
|
||||||
|
|
||||||
let unit = "week";
|
let unit = "week";
|
||||||
|
|
||||||
for (let i = 0; i < tests.length; i++) {
|
for (let i = 0; i < tests.length; i++) {
|
||||||
|
@ -70,12 +70,12 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
|||||||
template: (name, tag: any) => html`${name}
|
template: (name, tag: any) => html`${name}
|
||||||
${narrow
|
${narrow
|
||||||
? html`<div class="secondary">
|
? html`<div class="secondary">
|
||||||
${tag.last_scanned
|
${tag.last_scanned_datetime
|
||||||
? html`<ha-relative-time
|
? html`<ha-relative-time
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.datetimeObj=${tag.last_scanned_datetime}
|
.datetimeObj=${tag.last_scanned_datetime}
|
||||||
></ha-relative-time>`
|
></ha-relative-time>`
|
||||||
: this.hass.localize("ui.components.relative_time.never")}
|
: this.hass.localize("ui.panel.config.tags.never_scanned")}
|
||||||
</div>`
|
</div>`
|
||||||
: ""}`,
|
: ""}`,
|
||||||
},
|
},
|
||||||
@ -94,7 +94,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
|||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.datetimeObj=${last_scanned_datetime}
|
.datetimeObj=${last_scanned_datetime}
|
||||||
></ha-relative-time>`
|
></ha-relative-time>`
|
||||||
: this.hass.localize("ui.components.relative_time.never")}
|
: this.hass.localize("ui.panel.config.tags.never_scanned")}
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -319,6 +319,7 @@
|
|||||||
"past": "{time} ago",
|
"past": "{time} ago",
|
||||||
"future": "In {time}",
|
"future": "In {time}",
|
||||||
"never": "Never",
|
"never": "Never",
|
||||||
|
"just_now": "Just now",
|
||||||
"duration": {
|
"duration": {
|
||||||
"second": "{count} {count, plural,\n one {second}\n other {seconds}\n}",
|
"second": "{count} {count, plural,\n one {second}\n other {seconds}\n}",
|
||||||
"minute": "{count} {count, plural,\n one {minute}\n other {minutes}\n}",
|
"minute": "{count} {count, plural,\n one {minute}\n other {minutes}\n}",
|
||||||
@ -631,6 +632,7 @@
|
|||||||
"add_tag": "Add tag",
|
"add_tag": "Add tag",
|
||||||
"write": "Write",
|
"write": "Write",
|
||||||
"edit": "Edit",
|
"edit": "Edit",
|
||||||
|
"never_scanned": "Never scanned",
|
||||||
"create_automation": "Create automation with tag",
|
"create_automation": "Create automation with tag",
|
||||||
"automation_title": "Tag {name} is scanned",
|
"automation_title": "Tag {name} is scanned",
|
||||||
"headers": {
|
"headers": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user