diff --git a/strftime.js b/strftime.js index add6a49..2c726d4 100644 --- a/strftime.js +++ b/strftime.js @@ -3,7 +3,7 @@ // github.com/samsonjs/strftime // @_sjs // -// Copyright 2010 - 2013 Sami Samhuri +// Copyright 2010 - 2015 Sami Samhuri // // MIT License // http://sjs.mit-license.org @@ -45,7 +45,7 @@ // Browsers and other environments else { // Get the global object. Works in ES3, ES5, and ES5 strict mode. - namespace = (function(){ return this || (1,eval)('this') }()); + namespace = (function(){ return this || (1,eval)('this'); }()); } // Deprecated API, to be removed in v1.0 @@ -71,18 +71,18 @@ } var strftime = (locale ? defaultStrftime.localize(locale) : defaultStrftime).timezone(timezone); return strftime(fmt, d); - } + }; namespace.strftimeUTC = function(fmt, d, locale) { deprecationWarning("strftimeUTC", "require('strftime').utc()(format, date)` or `require('strftime').localize(locale).utc()(format, date)"); var strftime = (locale ? defaultStrftime.localize(locale) : defaultStrftime).utc(); return strftime(fmt, d); - } + }; namespace.localizedStrftime = function(locale) { deprecationWarning("localizedStrftime", "require('strftime').localize(locale)"); return defaultStrftime.localize(locale); - } + }; // End of deprecated API function Strftime(locale, customTimezoneOffset, useUtcTimezone) { diff --git a/test/test.js b/test/test.js index 42911b3..d212402 100755 --- a/test/test.js +++ b/test/test.js @@ -18,9 +18,7 @@ assert.fn = function(value, msg) { function assertFormat(time, format, expected, name, strftime) { var actual = strftime(format, time); - assert.equal(expected, actual, - name + '("' + format + '", ' + time + ') is ' + JSON.stringify(actual) - + ', expected ' + JSON.stringify(expected)); + assert.equal(expected, actual, name + '("' + format + '", ' + time + ') is ' + JSON.stringify(actual) + ', expected ' + JSON.stringify(expected)); } assert.format = function(format, expected, expectedUTC, time) { @@ -114,7 +112,7 @@ assert.format('%Y', '2011'); assert.format('%y', '11'); assert.format('%Z', null, 'GMT'); assert.format('%z', null, '+0000'); -assert.format('%%', '%') // any other char; +assert.format('%%', '%'); // any other char ok('GMT'); @@ -145,8 +143,8 @@ var it_IT = { var strftimeIT = strftime.localize(it_IT), strftimeITUTC = strftimeIT.utc(); assert.format_it = function(format, expected, expectedUTC) { - if (expected) { assertFormat(Time, format, expected, 'strftime.localize(it_IT)', strftimeIT) } - assertFormat(Time, format, expectedUTC || expected, 'strftime.localize(it_IT).utc()', strftimeITUTC) + if (expected) { assertFormat(Time, format, expected, 'strftime.localize(it_IT)', strftimeIT); } + assertFormat(Time, format, expectedUTC || expected, 'strftime.localize(it_IT).utc()', strftimeITUTC); }; assert.format_it('%A', 'martedi');