From 85bcbf7c3273efae2e9a96292a413c0660cb0048 Mon Sep 17 00:00:00 2001 From: Rory McGuire Date: Wed, 25 Jan 2017 13:48:13 +0200 Subject: [PATCH] support custom format dates such as "[$-409]mmm\-yy" --- xlsx.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xlsx.js b/xlsx.js index 04b0bc9..75b970f 100644 --- a/xlsx.js +++ b/xlsx.js @@ -7231,7 +7231,12 @@ function get_cell_style(styles, cell, opts) { function safe_format(p, fmtid, fillid, opts) { try { if(p.t === 'e') p.w = p.w || BErr[p.v]; - else if(fmtid === 0) { + else if (p.t=='n' && fmtid >= 164) { + p.t = 's'; + p.v = SSF.format(fmtid,p.v,_ssfopts); + // p.w = p.v; + // console.log('p.w', p); + } else if(fmtid === 0) { if(p.t === 'n') { if((p.v|0) === p.v) p.w = SSF._general_int(p.v,_ssfopts); else p.w = SSF._general_num(p.v,_ssfopts);