SheetJs - Date is exported as text #2825
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2825
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using SheetJS in Angular to export array of arrays to Excel. The issue I am having is SheetJs is not recognising my date data and instead treating it as a text value. Only when you double click on the value in excel it then recognises and converts to date.
I have tried setting the format. Even tested with a dummy value of New Date() but still no luck. Any ideas how I can make this field a date field? Big thanks in advance.
Code and screenshots below.
Screen shot of behaviour attached
You are passing strings, so
aoa_to_sheet
generates string cells.Try passing actual date objects:
Live example: https://jsfiddle.net/wqfg09ms/
Thanks so much for the prompt response we initially tried this but got a string. But after seeing your fiddle working correctly and realised our function that generates the array of array was concatting the date values and converting to string. After fixing this it now works!
Thanks again for such a great and important package!