From 9c1b2902193b6bd47861165eeaa9bc4e6c0b5ebf Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 18:11:44 +0200 Subject: [PATCH] Make sure date is date in dateString(). --- src/utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.js b/src/utils.js index 7644e4b..b057bca 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,5 +1,8 @@ const dateString = (date) => { + if (typeof(date) == "string") { + date = new Date(date); + } const ye = new Intl.DateTimeFormat('en', { year: 'numeric' }).format(date) const mo = new Intl.DateTimeFormat('en', { month: '2-digit' }).format(date) const da = new Intl.DateTimeFormat('en', { day: '2-digit' }).format(date)