mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 23:07:20 +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";
|
||||
delta = Math.abs(delta);
|
||||
let roundedDelta = Math.round(delta);
|
||||
|
||||
if (roundedDelta === 0) {
|
||||
return localize("ui.components.relative_time.just_now");
|
||||
}
|
||||
|
||||
let unit = "week";
|
||||
|
||||
for (let i = 0; i < tests.length; i++) {
|
||||
|
@ -70,12 +70,12 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
||||
template: (name, tag: any) => html`${name}
|
||||
${narrow
|
||||
? html`<div class="secondary">
|
||||
${tag.last_scanned
|
||||
${tag.last_scanned_datetime
|
||||
? html`<ha-relative-time
|
||||
.hass=${this.hass}
|
||||
.datetimeObj=${tag.last_scanned_datetime}
|
||||
></ha-relative-time>`
|
||||
: this.hass.localize("ui.components.relative_time.never")}
|
||||
: this.hass.localize("ui.panel.config.tags.never_scanned")}
|
||||
</div>`
|
||||
: ""}`,
|
||||
},
|
||||
@ -94,7 +94,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
||||
.hass=${this.hass}
|
||||
.datetimeObj=${last_scanned_datetime}
|
||||
></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",
|
||||
"future": "In {time}",
|
||||
"never": "Never",
|
||||
"just_now": "Just now",
|
||||
"duration": {
|
||||
"second": "{count} {count, plural,\n one {second}\n other {seconds}\n}",
|
||||
"minute": "{count} {count, plural,\n one {minute}\n other {minutes}\n}",
|
||||
@ -631,6 +632,7 @@
|
||||
"add_tag": "Add tag",
|
||||
"write": "Write",
|
||||
"edit": "Edit",
|
||||
"never_scanned": "Never scanned",
|
||||
"create_automation": "Create automation with tag",
|
||||
"automation_title": "Tag {name} is scanned",
|
||||
"headers": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user