Formatting Columns as Dates #977
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#977
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?
I have a Vue project that writes an excel file using SheetJS.
How do I set the format of the columns in my generated excel file?
I need to set the SalesOrderDate, CustomerRequestedDeliveryDate, ConfirmedDate, and _ProductionDate to date format.
Sample file generated from code below
production_schedule_example.xlsx
Code
@reviewher @SheetJSDev actually, there is no bug in the package, but it's about that we haven't caught the correct way to make it right.
our problem is that we have in our JSON data string dates, that are in the format of 'mm-dd-yyyy',
when we export those data to excel to client, the cell format is text by default for all fields and field date also, so we need to change the cell format for the date string field to be date in order to allow client to make sort upon it.
I have same issue as mentioned by @malek-itani . Is there any solution ?
The utilities like
json_to_sheet
will convert actual JSDate
to Excel datecode values with the appropriate format. It will not automagically convert date strings to dates.If you know which fields are supposed to be dates, you can just replace their values with the parsed equivalent e.g.