From 7c35fc546bb148047087db6ed95b1579bab08238 Mon Sep 17 00:00:00 2001 From: Filip785 Date: Thu, 9 Jul 2020 17:19:30 +0200 Subject: Create new migration to add `creator_published` field to the `post_view` and `comment_view` --- ui/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/src/utils.ts') 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 ( -- cgit v1.2.3