Problem exporting Date to Cell #1538

Open
opened 2019-06-14 13:28:27 +00:00 by msiqueira-dev · 1 comment
msiqueira-dev commented 2019-06-14 13:28:27 +00:00 (Migrated from github.com)

After reading the documentation, we discovered that we can get a cell reference by using:

cellref = XLSX.utils.encode_cell({ c: col, r: R });

With that variable mentioned before, cellref, we can get into it's properties like .v for value, .s for style and .t for type, and we been informed by e-mail that we can also access .z, witch receives a string and we need to setup a value for it in order to date to work correclty on excel.

Our real problem is that we been strugling to get it work for type (.t) of date ('d'). We tried to apply a date value treated as DD/MM/YYYY or MM/DD/YYYY and both of them got a final result on excel modified, with a different date. I used console.log() to get the value from cellref.v the last moment I had access to it and the date was with the correct value, but in Excel file it usually had one day less. We tried another approach to solve this out, that was to give on the .v a value as a Serial Number Value, that excel accepts and converts do Date. I managed to get a working function that calculates the value. If I get that value from console.log and paste on Excel field with type Date, the number is correclty converted into the corrected date. But when using the XLSX application, giving the .v that serial number value does not work and the date shown to me is 12/31/1969, witch is a default date for invalid date problem.

On the contact via e-mail I got informed to open a Ticket here for further support. I also don't really get what value I must assign to .z in other to get it work. Also, if any of you give me the right solution, please tell me if that should be applied with Serial Number value or just a Date pattern from JavaScript.

Thank you

After reading the documentation, we discovered that we can get a cell reference by using: cellref = XLSX.utils.encode_cell({ c: col, r: R }); With that variable mentioned before, cellref, we can get into it's properties like .v for value, .s for style and .t for type, and we been informed by e-mail that we can also access .z, witch receives a string and we need to setup a value for it in order to date to work correclty on excel. Our real problem is that we been strugling to get it work for type (.t) of date ('d'). We tried to apply a date value treated as DD/MM/YYYY or MM/DD/YYYY and both of them got a final result on excel modified, with a different date. I used console.log() to get the value from cellref.v the last moment I had access to it and the date was with the correct value, but in Excel file it usually had one day less. We tried another approach to solve this out, that was to give on the .v a value as a Serial Number Value, that excel accepts and converts do Date. I managed to get a working function that calculates the value. If I get that value from console.log and paste on Excel field with type Date, the number is correclty converted into the corrected date. But when using the XLSX application, giving the .v that serial number value does not work and the date shown to me is 12/31/1969, witch is a default date for invalid date problem. On the contact via e-mail I got informed to open a Ticket here for further support. I also don't really get what value I must assign to .z in other to get it work. Also, if any of you give me the right solution, please tell me if that should be applied with Serial Number value or just a Date pattern from JavaScript. Thank you
msiqueira-dev commented 2019-06-19 16:57:59 +00:00 (Migrated from github.com)

Any answer on that ?

Thank you

Any answer on that ? Thank you
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#1538
No description provided.