mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Simplify
This commit is contained in:
parent
f18997c7c3
commit
4fcfcbeefb
@ -130,12 +130,13 @@ class DialogCalendarEventDetail extends LitElement {
|
|||||||
|
|
||||||
private _renderRruleAsText(value: string) {
|
private _renderRruleAsText(value: string) {
|
||||||
// TODO: Make sure this handles translations
|
// TODO: Make sure this handles translations
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const readableText =
|
return html`<div id="text">
|
||||||
value === ""
|
${capitalizeFirstLetter(RRule.fromString(`RRULE:${value}`).toText())}
|
||||||
? ""
|
</div>`;
|
||||||
: capitalizeFirstLetter(RRule.fromString(`RRULE:${value}`).toText());
|
|
||||||
return html`<div id="text">${readableText}</div>`;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user