officegen
officegen copied to clipboard
XLSX Date support
Using the two dimensional array, dates are written as zero values:
var fs = require('fs');
var officegen = require('officegen');
var xlsx = officegen ( 'xlsx' );
xlsx.on ( 'finalize', function ( written ) {
console.log ( 'Finish to create an Excel file.\nTotal bytes created: ' + written + '\n' );
});
xlsx.on ( 'error', function ( err ) {
console.log ( err );
});
sheet = xlsx.makeNewSheet ();
sheet.name = 'Excel Test';
// The direct option - two-dimensional array:
sheet.data[0] = [];
sheet.data[0][0] = new Date();
var out = fs.createWriteStream ( 'out.xlsx' );
out.on ( 'error', function ( err ) {
console.log ( err );
});
xlsx.generate ( out );
+1, or some feature to set type of cells. For example if you put 02/16/2015 now not it's readed as date.
@lagomarsino, this is random but any way to contact you?