Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

date on the csv export is at +1 #185

Open
AlexandreVa opened this issue Aug 27, 2019 · 1 comment
Open

date on the csv export is at +1 #185

AlexandreVa opened this issue Aug 27, 2019 · 1 comment

Comments

@AlexandreVa
Copy link

AlexandreVa commented Aug 27, 2019

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

Capture d’écran 2019-08-27 à 13 58 02

Capture d’écran 2019-08-27 à 13 58 24

thanks

@IIIypuk09
Copy link

IIIypuk09 commented Dec 10, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants