From 6cd92acbe326e6622df49832e3a46cb57e6f92a1 Mon Sep 17 00:00:00 2001 From: Rickard Natt och Dag Date: Thu, 1 Apr 2021 13:02:35 +0200 Subject: [PATCH] fix: use parseDate for all date handling --- lib/parse.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/parse.ts b/lib/parse.ts index 94ad84278..937c6889f 100644 --- a/lib/parse.ts +++ b/lib/parse.ts @@ -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'), @@ -221,7 +221,7 @@ export const notification = ({ message: messagetext, sender: name, url: linkbackurl, - dateCreated: new Date(dateCreated).toISOString(), + dateCreated: parseDate(dateCreated) || '', category, type, })