sheetjs/bits/30_jsutils.js
SheetJS e1f8dbb863 version bump 0.7.2: bughunt
- read BOM, handle UTF16LE-encoded XML
- handle namespaces in [Content_Types].xml
- parse workbook rels to determine sheet files
- numbers OSX boolean support (apparently requires "0" or "1")
- XLSX force "General" style to be serialized, omit implied cell type and style
- updated SSF to 0.7.0 (h/t @sysarchitect)
- updated jszip to 2.2.2
- removed old tests/files path, replaced with test_files
- themes written
- ignore potential existence of thumbnail when calculating relationship ids
2014-05-22 05:16:51 -07:00

21 lines
552 B
JavaScript

function isval(x) { return typeof x !== "undefined" && x !== null; }
function keys(o) { return Object.keys(o).filter(function(x) { return o.hasOwnProperty(x); }); }
function evert(obj, arr) {
var o = {};
keys(obj).forEach(function(k) {
if(!obj.hasOwnProperty(k)) return;
if(!arr) o[obj[k]] = k;
else (o[obj[k]]=o[obj[k]]||[]).push(k);
});
return o;
}
/* TODO: date1904 logic */
function datenum(v, date1904) {
if(date1904) v+=1462;
var epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}