Skip to content

Commit

Permalink
fix: use parseDate for all date handling
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Apr 1, 2021
1 parent ca0a3e4 commit 6cd92ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export const newsItem = ({
altText,
}: any): NewsItem => ({
header,
published: pubDateSe ? new Date(pubDateSe).toISOString() : '',
modified: modDateSe ? new Date(modDateSe).toISOString() : '',
published: parseDate(pubDateSe) || '',
modified: parseDate(modDateSe) || '',
id: newsId,
author: authorDisplayName,
intro: preamble.replace(/([!,.])(\w)/gi, '$1 $2'),
Expand Down Expand Up @@ -221,7 +221,7 @@ export const notification = ({
message: messagetext,
sender: name,
url: linkbackurl,
dateCreated: new Date(dateCreated).toISOString(),
dateCreated: parseDate(dateCreated) || '',
category,
type,
})
Expand Down

0 comments on commit 6cd92ac

Please sign in to comment.