added check for undefined, null empty string

This commit is contained in:
Baris Soner Usakli
2014-01-18 23:28:13 -05:00
parent bbac361670
commit 9879f645f6

View File

@@ -185,12 +185,16 @@
},
toISOString: function(timestamp) {
if(!timestamp) {
return '';
}
try {
return new Date(parseInt(timestamp, 10)).toISOString();
} catch(e){
console.log(e.message);
console.log(timestamp, e.stack);
}
return new Date(parseInt(0, 10)).toISOString();
return '';
}
};