Fixed xml parsing of '0' in date1904

This commit is contained in:
SheetJS 2013-04-03 20:50:41 -04:00
parent a0b73e3d4f
commit 8fc0f91395
3 changed files with 11 additions and 3 deletions

@ -440,7 +440,11 @@ function parseWB(data) {
wb.WBView.forEach(function(w){for(var z in WBViewDef) if(null==w[z]) w[z]=WBViewDef[z]; });
wb.Sheets.forEach(function(w){for(var z in SheetDef) if(null==w[z]) w[z]=SheetDef[z]; });
_ssfopts.date1904 = wb.WBProps.date1904;
switch(wb.WBProps.date1904) {
case '0': case 0: case 'false': case 'FALSE': _ssfopts.date1904=false;break;
case '1': case 1: case 'true': case 'TRUE': _ssfopts.date1904 = true; break;
default: throw "unrecognized date1904: " + wb.WBProps.date1904;
}
return wb;
}

@ -1,6 +1,6 @@
{
"name": "xlsx",
"version": "0.2.1",
"version": "0.2.2",
"author": "Niggler",
"description": "(one day) a full-featured XLSX parser and writer. For now, primitive parser",
"keywords": [

@ -664,7 +664,11 @@ function parseWB(data) {
wb.WBView.forEach(function(w){for(var z in WBViewDef) if(null==w[z]) w[z]=WBViewDef[z]; });
wb.Sheets.forEach(function(w){for(var z in SheetDef) if(null==w[z]) w[z]=SheetDef[z]; });
_ssfopts.date1904 = wb.WBProps.date1904;
switch(wb.WBProps.date1904) {
case '0': case 0: case 'false': case 'FALSE': _ssfopts.date1904=false;break;
case '1': case 1: case 'true': case 'TRUE': _ssfopts.date1904 = true; break;
default: throw "unrecognized date1904: " + wb.WBProps.date1904;
}
return wb;
}