From 88fb1d9642aafd5f5209534664c4529f80ec19c6 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 27 May 2024 16:49:01 +0200 Subject: [PATCH] Use relative date --- src/panels/profile/ha-refresh-tokens-card.ts | 10 ++++++++-- src/translations/en.json | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/panels/profile/ha-refresh-tokens-card.ts b/src/panels/profile/ha-refresh-tokens-card.ts index 56f1cf55ccc6..8c186dee1ecf 100644 --- a/src/panels/profile/ha-refresh-tokens-card.ts +++ b/src/panels/profile/ha-refresh-tokens-card.ts @@ -136,10 +136,16 @@ class HaRefreshTokens extends LitElement {
${token.expire_at ? this.hass.localize( - "ui.panel.profile.refresh_tokens.expire_after_90_days" + "ui.panel.profile.refresh_tokens.expires_in", + { + date: relativeTime( + new Date(token.expire_at), + this.hass.locale + ), + } ) : this.hass.localize( - "ui.panel.profile.refresh_tokens.never_expire" + "ui.panel.profile.refresh_tokens.never_expires" )}
diff --git a/src/translations/en.json b/src/translations/en.json index 42a811f6377b..15e8cae081ea 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -6373,8 +6373,8 @@ "created_at": "Created {date}", "last_used": "Last used {date} from {location}", "not_used": "Has never been used", - "expire_after_90_days": "Expires after 90 days of inactivity", - "never_expire": "Never expires", + "expires_in": "Expires {date}", + "never_expires": "Never expires", "disable_token_expiration": "Disable token expiration", "enable_token_expiration": "Enable token expiration", "confirm_disable_token_expiration_title": "Disable token expiration?",