summaryrefslogtreecommitdiffstats
path: root/ui/src/utils.ts
diff options
context:
space:
mode:
authorFilip785 <fdjuricic98@gmail.com>2020-07-09 17:19:30 +0200
committerFilip785 <fdjuricic98@gmail.com>2020-07-09 17:19:30 +0200
commit7c35fc546bb148047087db6ed95b1579bab08238 (patch)
treec0955dacc2d54d7d267029bc6165d05770ba0f75 /ui/src/utils.ts
parent10a946cab3d40a30b2f9efc9d38a6a043eb25480 (diff)
Create new migration to add `creator_published` field to the `post_view` and `comment_view`
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 (