Skip to content

Commit

Permalink
fix(xlsx): error when date is malformed
Browse files Browse the repository at this point in the history
Encountered error when trying to export xlsx with 1/1/1 dates.
  • Loading branch information
cristinecula committed Oct 5, 2023
1 parent 7e08aef commit 15aa770
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/utils-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ export const
return '';
}
const localDate = toDate(toLocalISOString(date));
if (!localDate) {
return '';
}
localDate.setHours(0, 0, 0, 0);
return localDate;
},
Expand Down

0 comments on commit 15aa770

Please sign in to comment.