excel sheet date field lost first 2 digit #208
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#208
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
In the excel sheet, let's say there is a column with values of date type. In the values of date type, let us say one value is '4/15/2015'. When SheetJS gets the json data(use the api xlsxUtil.sheet_to_json(rosterFile.Sheets[rosterSheet])), the value '4/15/2015' is not there, but '4/15/15' is in the json. So it seems '2015' lost the first '20'. Is this a feature or bug?
Thanks
Jerry
@jerryhe88 I suspect this is the same as https://github.com/SheetJS/js-xlsx/issues/200 and https://github.com/SheetJS/js-xlsx/issues/181. To be sure, if you manually change the format for code 14 (see https://github.com/SheetJS/js-xlsx/issues/181#issuecomment-76733831) to 'm/d/yyyy', do you see 2 or 4 digits?
thanks for quick reply. Not sure what needs to do after reading #200 and #181.
The below is the file and code:
filePath.xlsx has data like '4/15/2015';
var fileContent = xlsx.readFile(filePath.xlsx);
var rowDatas = xlsxUtil.sheet_to_json(fileContent.Sheets['Template']);
after the above,
rowDatas has '4/15/15'. Can you please provide sample codes or configs so that rowDatas can have '4/15/2015'?
thanks again
jerry
In 0.9.13 we're adding a
dateNF
option for the parsers to override the interpretation of the default dates: