From 15aa770820b07738004e65c196d99aeab6c53867 Mon Sep 17 00:00:00 2001 From: Cristian Necula Date: Thu, 5 Oct 2023 22:55:49 +0300 Subject: [PATCH] fix(xlsx): error when date is malformed Encountered error when trying to export xlsx with 1/1/1 dates. --- lib/utils-date.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils-date.js b/lib/utils-date.js index fadcbbe9..05aabba0 100644 --- a/lib/utils-date.js +++ b/lib/utils-date.js @@ -187,6 +187,9 @@ export const return ''; } const localDate = toDate(toLocalISOString(date)); + if (!localDate) { + return ''; + } localDate.setHours(0, 0, 0, 0); return localDate; },