diff --git a/frontend/app/blog/post/[id]/Footer.tsx b/frontend/app/blog/post/[id]/Footer.tsx index 3c71bc2..6802851 100644 --- a/frontend/app/blog/post/[id]/Footer.tsx +++ b/frontend/app/blog/post/[id]/Footer.tsx @@ -17,7 +17,7 @@ const Footer = (props: Props) => { const author = post['meta']['author'] ?? 'Tao'; const author_link = post['meta']['author_link'] ?? '/about'; const post_date = new Date(post['first_update']); - const update_date = new Date(post['last_update']); + const update_date: Date | undefined = post['last_update'] ? new Date(post['last_update']) : undefined; const cc = post['meta']['cc'] ?? 'by-nc-sa'; @@ -55,14 +55,16 @@ const Footer = (props: Props) => { year: `numeric` }) }

-
-

Updated on

-

{ update_date.toLocaleString('default', { - month: `long`, - day: `numeric`, - year: `numeric` - }) }

-
+ { update_date && +
+

Updated on

+

{ update_date.toLocaleString('default', { + month: `long`, + day: `numeric`, + year: `numeric` + }) }

+
+ }

Published under