refactor(environment.ts): if-Anweisung hinzugefügt, um einen leeren String zurückzugeben, wenn volidFrom oder validTo null ist

This commit is contained in:
Developer 02 2024-11-11 15:36:30 +01:00
parent b1011c3ea2
commit 0a8a5208a0
2 changed files with 11 additions and 3 deletions

View File

@ -165,6 +165,14 @@ export const env = {
header: "Repr. Benutzer", header: "Repr. Benutzer",
field: (ur: any) => ur.repUser?.username field: (ur: any) => ur.repUser?.username
}, },
{
header: "Gültig von",
field: (ur: any) => ur.validFrom ? new Date(ur.validFrom).toLocaleDateString('de-DE') : ""
},
{
header: "Gültig bis",
field: (ur: any) => ur.validTo ? new Date(ur.validTo).toLocaleDateString('de-DE') : ""
}
] ]
}, },
config_url: "/assets/config.json", config_url: "/assets/config.json",

View File

@ -167,11 +167,11 @@ export const env = {
}, },
{ {
header: "Gültig von", header: "Gültig von",
field: (ur: any) => new Date(ur.validFrom).toLocaleDateString('de-DE') field: (ur: any) => ur.validFrom ? new Date(ur.validFrom).toLocaleDateString('de-DE') : ""
}, },
{ {
header: "Gültig bis", header: "Gültig bis",
field: (ur: any) => new Date(ur.validTo).toLocaleDateString('de-DE') field: (ur: any) => ur.validTo ? new Date(ur.validTo).toLocaleDateString('de-DE') : ""
} }
] ]
}, },
@ -196,4 +196,4 @@ export const env = {
{ value: "en-US", name: "en-US" } { value: "en-US", name: "en-US" }
] ]
} }
}; };