summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r--ui/src/utils.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts
index a418c569..e38834aa 100644
--- a/ui/src/utils.ts
+++ b/ui/src/utils.ts
@@ -503,7 +503,9 @@ export function showAvatars(): boolean {
}
export function isCakeDay(creator_published: string): boolean {
- const userCreationDate = moment.utc(creator_published).local();
+ // moment(undefined) or moment.utc(undefined) returns the current date/time
+ // moment(null) or moment.utc(null) returns null
+ const userCreationDate = moment.utc(creator_published || null).local();
const currentDate = moment(new Date());
return (