clarketm / TableExport

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
https://tableexport.travismclarke.com/
Apache License 2.0
888 stars 289 forks source link

Usage of date.js causes errors #174

Open saslanis opened 5 years ago

saslanis commented 5 years ago

If you use the date.js library export does not work because date.js parse method returns null while Date.parse returns NaN on wrong dates.

So just change line 345 from

return !/.*%/.test(v) && !isNaN(Date.parse(v));

to

return !/.*%/.test(v) && !(Date.parse(v) == null);

thanks for the tool