TableExport
TableExport copied to clipboard
date on the csv export is at +1
Hi,
I need to export an array in xlsx and csv. in xlsx it works fine but in csv the date is incorrect after export. i have try with class="tableexport-string" and class="tableexport-string target" but it does not work
thanks
I faced out with the same issue, exported data in xlsx contained wrong date cells. actual date is less than 1. The problem is in function dateNum (file tableexport.js, line 486)
dateNum: function (v, date1904) { if (date1904) v += 1462; var epoch = Date.parse(v); var result = (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000); return Math.floor(result); },
Incorrect rounding at the end of function - Math.floor, it should be Math.round at least.