jquery-table2excel icon indicating copy to clipboard operation
jquery-table2excel copied to clipboard

about date format problem

Open zhoubohao0504 opened this issue 7 years ago • 2 comments

I tried to export a date, for example, 2018-02, when I opened the export file, I found that the date format was Feb-18.

zhoubohao0504 avatar Apr 11 '18 06:04 zhoubohao0504

I have same issue in html to excel date like 19-Dec-2020 or 25-Nov-1999 in excel i get output 19-Dec-20 or 25-Nov-99. In case of 19-Dec-1899 , I get output 19-Dec-1899 it's perfect . Please help me

ketan365 avatar Dec 21 '19 10:12 ketan365

Unless a cell's format is explicitly set, it will do its best to auto detect the contents. I think we would need to mark a cell with another attribute to indicate its data type, then just assign that data type to the cell.

I'm thinking "data-type" for the attribute name and the value should reflect a valid option from Excel data types allowed in the XLSX format ( https://docs.microsoft.com/en-us/office/client-developer/excel/data-types-used-by-excel .)

We should check for the existence of this field on the field itself and its ancestors up to the table element so that the data type can be defined as high as the table or as low as a specific cell and inherit to all cells below that which do not have a declared data type.

I'll leave this open for discussion for a couple days to see if anybody wants to provide feedback or take the PR for it and after that discussion, if nobody else has I will.

rainabba avatar Dec 21 '19 15:12 rainabba