"new Date()" function work in chrome not expected #709

Closed
opened 2017-06-28 12:56:08 +00:00 by mz121star · 1 comment
mz121star commented 2017-06-28 12:56:08 +00:00 (Migrated from github.com)

if (v != null && v.length) {
if (!isNaN(Number(v)))
o = {
t: "n",
v: Number(v)
};
else if (!isNaN(fuzzydate(v).getDate())) {
o = {
t: "d",
v: parseDate(v)
};
if (!opts.cellDates)
o = {
t: "n",
v: datenum(o.v)
};
o.z = opts.dateNF || SSF._table[14]
}
}

example:
Number('4,001')
chrome input: Sun Apr 01 2001 00:00:00 GMT+0800 (CST)
firefox input:Invalid Date

if (v != null && v.length) { if (!isNaN(Number(v))) o = { t: "n", v: Number(v) }; else if (!isNaN(fuzzydate(v).getDate())) { o = { t: "d", v: parseDate(v) }; if (!opts.cellDates) o = { t: "n", v: datenum(o.v) }; o.z = opts.dateNF || SSF._table[14] } } example: Number('4,001') chrome input: Sun Apr 01 2001 00:00:00 GMT+0800 (CST) firefox input:Invalid Date
SheetJSDev commented 2017-08-09 22:42:05 +00:00 (Migrated from github.com)

@mz121star we started digging into how to properly detect numbers versus potential dates. To first order, we strip the $ currency symbol now and remove commas between numbers, which does work for the case 4,001.

@mz121star we started digging into how to properly detect numbers versus potential dates. To first order, we strip the `$` currency symbol now and remove commas between numbers, which does work for the case `4,001`.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#709
No description provided.