diff --git a/lib/xlsx/xform/simple/date-xform.js b/lib/xlsx/xform/simple/date-xform.js index 72c60fcee..e64c096d9 100644 --- a/lib/xlsx/xform/simple/date-xform.js +++ b/lib/xlsx/xform/simple/date-xform.js @@ -13,7 +13,13 @@ var DateXform = module.exports = function(options) { this.tag = options.tag; this.attr = options.attr; this.attrs = options.attrs; - this._format = options.format || function(dt) { return dt.toISOString(); }; + this._format = options.format || function (dt) { + try { + return dt.toISOString(); + } catch(e) { + return ''; + } + }; this._parse = options.parse || function(str) { return new Date(str); }; };