In Chrome for CSV file Date format converts days to months #2704
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#2704
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?
After import of CSV file where columns have values like 31.10.2022 which is format "dd.MM.yyyy" with setting cellDates false or true format on Chrome browser (language set to en or pl version (both tested)) is changed to mm/dd/yyyy sometimes m/d/yy.
It is impossible to detect if the day is a month or a month is a day when values are smaller than 12. There is no workaround for this issue. Note that resolved data in case of Date (cellDates: true) for xlsx file also convert days to months. In CSV files forcing columns to have a specific date format doesn't help.
For Firefox (which uses Geko engine, not V8) keep the good format.
My method to convert File to JSON.
You should be able to recreate this issue here: oss.sheetjs.com with CSV with columns of format dd.MM.yyyy
CSV date parsing eventually passes through the Date constructor, and Chrome's parser is notoriously problematic. Can you run
new Date("5.6.2022")
in the browser console to determine which interpretation is used by default?Output from console
When I do copy(test) and paste in notepad it gives me "2022-05-05T22:00:00.000Z".
any solution for this issue even though I m facing the same issue while converting the CSV to xlsx date format is getting changes from dd-mm-yyyy to mm/dd/yyyy when downloading the file
attaching the code below if anyone has any suggestions it will be great help
file = XLSX.read(content, { type: 'string', cellText: false, cellDates: true, cellNF: true }); const XLSXFileData = XLSX.write(file, {buffer, bookType:'xlsx;,
Sorry to say that but because of this problem we moved to the other library which solved this issue.
https://gitlab.com/catamphetamine/read-excel-file