1
forked from sheetjs/sheetjs

version bump 0.9.3

- fix rollover for near-integral dates (h/t @HuFlungDu)
- removed ssf.md from npm dist
This commit is contained in:
SheetJS 2017-05-16 15:22:19 -04:00
parent 842415c41d
commit 5bcd966b22
8 changed files with 14 additions and 12 deletions

@ -39,3 +39,4 @@ bits/
.vocrc .vocrc
v8.log v8.log
perf.log perf.log
ssf.md

@ -50,7 +50,7 @@ travis: ## Run test suite with minimal output
mocha -R dot -t 30000 mocha -R dot -t 30000
.PHONY: ctest .PHONY: ctest
ctest: ctest: ## Build browser test fixtures
browserify -t brfs test/{dateNF,exp,fraction,general,implied,oddities,utilities,comma,valid}.js > ctest/test.js browserify -t brfs test/{dateNF,exp,fraction,general,implied,oddities,utilities,comma,valid}.js > ctest/test.js
.PHONY: ctestserv .PHONY: ctestserv

@ -1 +1 @@
SSF.version = '0.9.2'; SSF.version = '0.9.3';

@ -6,9 +6,9 @@ function parse_date_code(v/*:number*/,opts/*:?any*/,b2/*:?boolean*/) {
if(Math.abs(out.u) < 1e-6) out.u = 0; if(Math.abs(out.u) < 1e-6) out.u = 0;
fixopts(opts != null ? opts : (opts=[])); fixopts(opts != null ? opts : (opts=[]));
if(opts.date1904) date += 1462; if(opts.date1904) date += 1462;
if(out.u > 0.999) { if(out.u > 0.9999) {
out.u = 0; out.u = 0;
if(++time == 86400) { time = 0; ++date; } if(++time == 86400) { out.T = time = 0; ++date; ++out.D; }
} }
if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;} if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;} else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}

@ -1,6 +1,6 @@
{ {
"name": "ssf", "name": "ssf",
"version": "0.9.2", "version": "0.9.3",
"author": "SheetJS", "author": "SheetJS",
"description": "Format data using ECMA-376 spreadsheet Format Codes", "description": "Format data using ECMA-376 spreadsheet Format Codes",
"keywords": [ "format", "sprintf", "spreadsheet" ], "keywords": [ "format", "sprintf", "spreadsheet" ],
@ -15,7 +15,7 @@
}, },
"devDependencies": { "devDependencies": {
"mocha":"", "mocha":"",
"uglify-js":"" "@sheetjs/uglify-js":""
}, },
"repository": { "type":"git", "url":"git://github.com/SheetJS/ssf.git" }, "repository": { "type":"git", "url":"git://github.com/SheetJS/ssf.git" },
"scripts": { "scripts": {

@ -2,7 +2,7 @@
/*jshint -W041 */ /*jshint -W041 */
var SSF = {}; var SSF = {};
var make_ssf = function make_ssf(SSF){ var make_ssf = function make_ssf(SSF){
SSF.version = '0.9.2'; SSF.version = '0.9.3';
function _strrev(x/*:string*/)/*:string*/ { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; } function _strrev(x/*:string*/)/*:string*/ { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }
function fill(c/*:string*/,l/*:number*/)/*:string*/ { var o = ""; while(o.length < l) o+=c; return o; } function fill(c/*:string*/,l/*:number*/)/*:string*/ { var o = ""; while(o.length < l) o+=c; return o; }
function pad0(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;} function pad0(v/*:any*/,d/*:number*/)/*:string*/{var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
@ -152,9 +152,9 @@ function parse_date_code(v/*:number*/,opts/*:?any*/,b2/*:?boolean*/) {
if(Math.abs(out.u) < 1e-6) out.u = 0; if(Math.abs(out.u) < 1e-6) out.u = 0;
fixopts(opts != null ? opts : (opts=[])); fixopts(opts != null ? opts : (opts=[]));
if(opts.date1904) date += 1462; if(opts.date1904) date += 1462;
if(out.u > 0.999) { if(out.u > 0.9999) {
out.u = 0; out.u = 0;
if(++time == 86400) { time = 0; ++date; } if(++time == 86400) { out.T = time = 0; ++date; ++out.D; }
} }
if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;} if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;} else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}

6
ssf.js

@ -2,7 +2,7 @@
/*jshint -W041 */ /*jshint -W041 */
var SSF = {}; var SSF = {};
var make_ssf = function make_ssf(SSF){ var make_ssf = function make_ssf(SSF){
SSF.version = '0.9.2'; SSF.version = '0.9.3';
function _strrev(x) { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; } function _strrev(x) { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }
function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; } function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
function pad0(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;} function pad0(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
@ -152,9 +152,9 @@ function parse_date_code(v,opts,b2) {
if(Math.abs(out.u) < 1e-6) out.u = 0; if(Math.abs(out.u) < 1e-6) out.u = 0;
fixopts(opts != null ? opts : (opts=[])); fixopts(opts != null ? opts : (opts=[]));
if(opts.date1904) date += 1462; if(opts.date1904) date += 1462;
if(out.u > 0.999) { if(out.u > 0.9999) {
out.u = 0; out.u = 0;
if(++time == 86400) { time = 0; ++date; } if(++time == 86400) { out.T = time = 0; ++date; ++out.D; }
} }
if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;} if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;} else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}

@ -158,5 +158,6 @@
["\\,##.??;\\(#,###.??\\);0", [15,",15. ","#"], [14.3453453,",14.35","#"], [12.1,",12.1 ","#"], [0,"0","#"], [-15,"(15. )","#"], [-14.3453453,"(14.35)","#"], [-12.1,"(12.1 )","#"], [1,",1. ","#"]], ["\\,##.??;\\(#,###.??\\);0", [15,",15. ","#"], [14.3453453,",14.35","#"], [12.1,",12.1 ","#"], [0,"0","#"], [-15,"(15. )","#"], [-14.3453453,"(14.35)","#"], [-12.1,"(12.1 )","#"], [1,",1. ","#"]],
["\"£\"#.####;-\"£\"#.####", [3.141592654, "£3.1416"], [-3.141592654, "-£3.1416"]], ["\"£\"#.####;-\"£\"#.####", [3.141592654, "£3.1416"], [-3.141592654, "-£3.1416"]],
["[h]:mm:ss;@", [2.9999999999999996, "72:00:00"]],
["\"foo\";\"bar\";\"baz\";\"qux\";\"foobar\"", [1], [0], [-1], ["sheetjs"]] ["\"foo\";\"bar\";\"baz\";\"qux\";\"foobar\"", [1], [0], [-1], ["sheetjs"]]
] ]