Do not display full dates if day and month are unknown

This commit is contained in:
2023-08-26 08:04:02 +02:00
parent cf7ad598db
commit b5dc78a8e1
2 changed files with 4 additions and 1 deletions

View File

@ -176,6 +176,9 @@ export class Member implements MemberDataApi {
}
export function fmtDate(d?: DateValue): string {
if (d?.year && !d.month && !d.day)
return d?.year?.toString().padStart(4, "0");
return `${d?.day?.toString().padStart(2, "0") ?? "__"}/${
d?.month?.toString().padStart(2, "0") ?? "__"
}/${d?.year?.toString().padStart(4, "0") ?? "__"}`;