209 files

This commit is contained in:
Home Assistant Version Control
2026-10-07 13:11:05 +00:00
parent 4fef64cc2c
commit 983811cb93
209 changed files with 714 additions and 26066 deletions
@@ -12,7 +12,7 @@
*/
import { html, nothing } from "lit";
import { t, formatDate, formatDueDays, formatNumber } from "../styles";
import { t, formatDate, formatDueDays, formatLastDone, formatNumber } from "../styles";
import { px } from "./chart-utils";
import { daysProgress } from "../helpers/interval";
import { stampMs } from "../helpers/ha-time";
@@ -296,6 +296,24 @@ export function renderMiniSparkline(
`;
}
/** The due column's text: days until due, or, for a task without a due date
* (manual, sensor-only, paused), when it was last done (D#203) — muted, so
* it never reads as a status. A bare dash only for a task never done. */
export function renderDueText(
days: number | null | undefined,
lastPerformed: string | null | undefined,
lang: string,
cls = "due-text",
) {
if (days == null) {
const done = formatLastDone(lastPerformed, lang);
if (done) {
return html`<span class="${cls} last-done" title="${t("last_performed", lang)}: ${formatDate(lastPerformed, lang)}">${done}</span>`;
}
}
return html`<span class="${cls}">${formatDueDays(days, lang)}</span>`;
}
/** A detailed days-progress bar (last performed → next due) for the detail view. */
export function renderDaysProgress(task: MaintenanceTask, lang: string) {
const L = lang;