Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "dateformat", | ||
"description": "Date format lib", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/firstandthird/dateformat", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
0.4.1 / 2014-08-12 | ||
================== | ||
* fixed %n returning month+1 | ||
0.4.0 / 2014-07-09 | ||
@@ -3,0 +8,0 @@ ================== |
/*! | ||
* dateformat - Date format lib | ||
* v0.4.0 | ||
* v0.4.1 | ||
* https://github.com/firstandthird/dateformat | ||
@@ -54,3 +54,3 @@ * copyright First + Third 2014 | ||
case '%n': | ||
return time.getMonth(); | ||
return time.getMonth() + 1; | ||
case '%Y': | ||
@@ -103,2 +103,2 @@ return time.getFullYear(); | ||
}).call(this); | ||
}).call(this); |
/*! | ||
* dateformat - Date format lib | ||
* v0.4.0 | ||
* v0.4.1 | ||
* https://github.com/firstandthird/dateformat | ||
@@ -8,2 +8,2 @@ * copyright First + Third 2014 | ||
*/ | ||
(function(){var a=this,b=a.dateFormat,c="January|February|March|April|May|June|July|August|September|October|November|December".split("|"),d="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|"),e=function(a,b){return!b instanceof Date?void 0:a.replace(/%d|%D|%j|%l|%S|%w|%F|%m|%M|%n|%Y|%y|%a|%A|%g|%G|%h|%H|%i|%s|%u|%e/g,function(a){switch(a){case"%d":return("0"+b.getDate()).slice(-2);case"%D":return d[b.getDay()].substr(0,3);case"%j":return b.getDate();case"%l":return d[b.getDay()];case"%S":return 1===b.getDate()?"st":2===b.getDate()?"nd":3===b.getDate()?"rd":"th";case"%w":return b.getDay();case"%F":return c[b.getMonth()];case"%m":return("0"+(b.getMonth()+1)).slice(-2);case"%M":return c[b.getMonth()].substr(0,3);case"%n":return b.getMonth();case"%Y":return b.getFullYear();case"%y":return b.getFullYear().toString().slice(-2);case"%a":return b.getHours()>11?"pm":"am";case"%A":return b.getHours()>11?"PM":"AM";case"%g":return b.getHours()>12?b.getHours()-12:b.getHours()?b.getHours():12;case"%G":return b.getHours();case"%h":return("0"+(b.getHours()>12?b.getHours()-12:b.getHours())).slice(-2);case"%H":return("0"+b.getHours()).slice(-2);case"%i":return("0"+b.getMinutes()).slice(-2);case"%s":return("0"+b.getSeconds()).slice(-2);case"%u":return b.getMilliseconds();case"%e":return b.getTimezoneOffset()}})};e.translate=function(a,b){c=a,d=b},e.noConflict=function(){return a.dateFormat=b,e},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.dateFormat=e):a.dateFormat=e}).call(this); | ||
(function(){var a=this,b=a.dateFormat,c="January|February|March|April|May|June|July|August|September|October|November|December".split("|"),d="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|"),e=function(a,b){return!b instanceof Date?void 0:a.replace(/%d|%D|%j|%l|%S|%w|%F|%m|%M|%n|%Y|%y|%a|%A|%g|%G|%h|%H|%i|%s|%u|%e/g,function(a){switch(a){case"%d":return("0"+b.getDate()).slice(-2);case"%D":return d[b.getDay()].substr(0,3);case"%j":return b.getDate();case"%l":return d[b.getDay()];case"%S":return 1===b.getDate()?"st":2===b.getDate()?"nd":3===b.getDate()?"rd":"th";case"%w":return b.getDay();case"%F":return c[b.getMonth()];case"%m":return("0"+(b.getMonth()+1)).slice(-2);case"%M":return c[b.getMonth()].substr(0,3);case"%n":return b.getMonth()+1;case"%Y":return b.getFullYear();case"%y":return b.getFullYear().toString().slice(-2);case"%a":return b.getHours()>11?"pm":"am";case"%A":return b.getHours()>11?"PM":"AM";case"%g":return b.getHours()>12?b.getHours()-12:b.getHours()?b.getHours():12;case"%G":return b.getHours();case"%h":return("0"+(b.getHours()>12?b.getHours()-12:b.getHours())).slice(-2);case"%H":return("0"+b.getHours()).slice(-2);case"%i":return("0"+b.getMinutes()).slice(-2);case"%s":return("0"+b.getSeconds()).slice(-2);case"%u":return b.getMilliseconds();case"%e":return b.getTimezoneOffset()}})};e.translate=function(a,b){c=a,d=b},e.noConflict=function(){return a.dateFormat=b,e},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.dateFormat=e):a.dateFormat=e}).call(this); |
/*! | ||
* dateformat - Date format lib | ||
* v0.4.0 | ||
* v0.4.1 | ||
* https://github.com/firstandthird/dateformat | ||
@@ -53,3 +53,3 @@ * copyright First + Third 2014 | ||
case '%n': | ||
return time.getMonth(); | ||
return time.getMonth() + 1; | ||
case '%Y': | ||
@@ -102,2 +102,2 @@ return time.getFullYear(); | ||
}).call(this); | ||
}).call(this); |
/*! | ||
* dateformat - Date format lib | ||
* v0.4.0 | ||
* v0.4.1 | ||
* https://github.com/firstandthird/dateformat | ||
@@ -8,2 +8,2 @@ * copyright First + Third 2014 | ||
*/ | ||
(function(){var a=this,b=a.dateFormat,c="January|February|March|April|May|June|July|August|September|October|November|December".split("|"),d="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|"),e=function(a,b){return!b instanceof Date?void 0:a.replace(/%d|%D|%j|%l|%S|%w|%F|%m|%M|%n|%Y|%y|%a|%A|%g|%G|%h|%H|%i|%s|%u|%e/g,function(a){switch(a){case"%d":return("0"+b.getDate()).slice(-2);case"%D":return d[b.getDay()].substr(0,3);case"%j":return b.getDate();case"%l":return d[b.getDay()];case"%S":return 1===b.getDate()?"st":2===b.getDate()?"nd":3===b.getDate()?"rd":"th";case"%w":return b.getDay();case"%F":return c[b.getMonth()];case"%m":return("0"+(b.getMonth()+1)).slice(-2);case"%M":return c[b.getMonth()].substr(0,3);case"%n":return b.getMonth();case"%Y":return b.getFullYear();case"%y":return b.getFullYear().toString().slice(-2);case"%a":return b.getHours()>11?"pm":"am";case"%A":return b.getHours()>11?"PM":"AM";case"%g":return b.getHours()>12?b.getHours()-12:b.getHours()?b.getHours():12;case"%G":return b.getHours();case"%h":return("0"+(b.getHours()>12?b.getHours()-12:b.getHours())).slice(-2);case"%H":return("0"+b.getHours()).slice(-2);case"%i":return("0"+b.getMinutes()).slice(-2);case"%s":return("0"+b.getSeconds()).slice(-2);case"%u":return b.getMilliseconds();case"%e":return b.getTimezoneOffset()}})};e.translate=function(a,b){c=a,d=b},e.noConflict=function(){return a.dateFormat=b,e},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.dateFormat=e):a.dateFormat=e}).call(this); | ||
(function(){var a=this,b=a.dateFormat,c="January|February|March|April|May|June|July|August|September|October|November|December".split("|"),d="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|"),e=function(a,b){return!b instanceof Date?void 0:a.replace(/%d|%D|%j|%l|%S|%w|%F|%m|%M|%n|%Y|%y|%a|%A|%g|%G|%h|%H|%i|%s|%u|%e/g,function(a){switch(a){case"%d":return("0"+b.getDate()).slice(-2);case"%D":return d[b.getDay()].substr(0,3);case"%j":return b.getDate();case"%l":return d[b.getDay()];case"%S":return 1===b.getDate()?"st":2===b.getDate()?"nd":3===b.getDate()?"rd":"th";case"%w":return b.getDay();case"%F":return c[b.getMonth()];case"%m":return("0"+(b.getMonth()+1)).slice(-2);case"%M":return c[b.getMonth()].substr(0,3);case"%n":return b.getMonth()+1;case"%Y":return b.getFullYear();case"%y":return b.getFullYear().toString().slice(-2);case"%a":return b.getHours()>11?"pm":"am";case"%A":return b.getHours()>11?"PM":"AM";case"%g":return b.getHours()>12?b.getHours()-12:b.getHours()?b.getHours():12;case"%G":return b.getHours();case"%h":return("0"+(b.getHours()>12?b.getHours()-12:b.getHours())).slice(-2);case"%H":return("0"+b.getHours()).slice(-2);case"%i":return("0"+b.getMinutes()).slice(-2);case"%s":return("0"+b.getSeconds()).slice(-2);case"%u":return b.getMilliseconds();case"%e":return b.getTimezoneOffset()}})};e.translate=function(a,b){c=a,d=b},e.noConflict=function(){return a.dateFormat=b,e},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=e),exports.dateFormat=e):a.dateFormat=e}).call(this); |
@@ -46,3 +46,3 @@ /** | ||
case '%n': | ||
return time.getMonth(); | ||
return time.getMonth() + 1; | ||
case '%Y': | ||
@@ -95,2 +95,2 @@ return time.getFullYear(); | ||
}).call(this); | ||
}).call(this); |
{ | ||
"name": "datefmt", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"main": "dist/dateformat.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
/* global suite, assert, test, dateFormat */ | ||
suite('dateFormat', function() { | ||
@@ -16,7 +16,11 @@ test('day', function() { | ||
assert.equal(dateFormat('%n %F %m %M', date), '3 April 04 Apr'); | ||
assert.equal(dateFormat('%n %F %m %M', date), '4 April 04 Apr'); | ||
var date2 = new Date(2013, 11, 15); | ||
assert.equal(dateFormat('%n %F %m %M', date2), '11 December 12 Dec'); | ||
assert.equal(dateFormat('%n %F %m %M', date2), '12 December 12 Dec'); | ||
var date3 = new Date(2013, 12, 15); | ||
assert.equal(dateFormat('%n %F %m %M', date3), '1 January 01 Jan'); | ||
}); | ||
@@ -81,2 +85,2 @@ | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18603
367