Convert html to xlxs: numbers became date #772
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#772
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?
We are converting html table to xlxs/csv, for some data, the number became date.
For example, $41.08 was exported as "31-07-2041 4:00:00 PM"
Different combination of options have be tested:
var wopts = { bookType: type, bookSST: false, type: 'binary', raw: true, cellNF: true, cellDates : false, dateNF: 2},
Any suggestion?
We are pushing a change in the next release so that currencies and thousands-separated numbers are properly recognized as numbers. IF you find any other strange cases, please let us know
i also got a similar issue like this.
just found that in case UTF-8 encoded, one ore more chinese & japanese character/string combine with one space and one number ending (ex. "漢 1" or "漢漢漢漢 123" or "あ 1") in a HTML table cell (ex
<td>あ 1</td>
), will cause output as xlsx format error as Date format (such like<c r="B2" s="1"><v>36892</v></c>
)but when i replace the space character in the HTML table with HTML special char (ex. "漢漢漢漢** **123") , it will export the right format as string cell.
i got the same issue in the demo table.
@jyyan that's coming from a combination of two problems:
V8 date parsing is extremely robust. Try
new Date("absolute nonsense 1")
ornew Date("漢 1")
to seeThe original correction rejected dates if it contained English letters that weren't part of a month name. We're going to flip this to reject if any letters are detected.
@SheetJSDev
thats right ! thanks for your help :P