From 49568677a7b24712308f52bef953094de7171bf5 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 5 Mar 2015 16:51:05 -0800 Subject: [PATCH] v0.8.4 --- bower.json | 2 +- component.json | 2 +- package.json | 2 +- strftime-min.js | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index ea48f3b..0eb519b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "strftime", - "version": "0.8.3", + "version": "0.8.4", "main": "strftime.js", "ignore": [ "Readme.md", diff --git a/component.json b/component.json index c3c352a..764f0e5 100644 --- a/component.json +++ b/component.json @@ -3,7 +3,7 @@ "repo": "samsonjs/strftime", "description": "strftime date formatting", "keywords": ["strftime", "format", "date", "time"], - "version": "0.8.2", + "version": "0.8.4", "main": "strftime.js", "scripts": ["strftime.js"] } diff --git a/package.json b/package.json index 9571a28..d488e82 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "strftime", "description": "strftime for JavaScript", - "version": "0.8.2", + "version": "0.8.4", "homepage": "http://samhuri.net/proj/strftime", "author": "Sami Samhuri ", "contributors": [ diff --git a/strftime-min.js b/strftime-min.js index afb03e1..2146911 100644 --- a/strftime-min.js +++ b/strftime-min.js @@ -1,8 +1,8 @@ -(function(){function i(c,a,b){return g(c,a,b)}function g(c,a,b,j){j=j||{};a&&!n(a)&&(b=a,a=void 0);a=a||new Date;b=b||o;b.formats=b.formats||{};var i=a.getTime(),h=j.timezone,e=typeof h;if(j.utc||e=="number"||e=="string")a=p(a);if(h){if(e=="string")var k=h[0]=="-"?-1:1,q=parseInt(h.slice(1,3),10),r=parseInt(h.slice(3,5),10),h=k*(60*q+r);e&&(a=new Date(a.getTime()+h*6E4))}return c.replace(/%([-_0]?.)/g,function(c,e){var d;if(e.length==2){d=e[0];if(d=="-")d="";else if(d=="_")d=" ";else if(d=="0")d= -"0";else return c;e=e[1]}switch(e){case "A":return b.days[a.getDay()];case "a":return b.shortDays[a.getDay()];case "B":return b.months[a.getMonth()];case "b":return b.shortMonths[a.getMonth()];case "C":return f(Math.floor(a.getFullYear()/100),d);case "D":return g(b.formats.D||"%m/%d/%y",a,b);case "d":return f(a.getDate(),d);case "e":return f(a.getDate(),d==null?" ":d);case "F":return g(b.formats.F||"%Y-%m-%d",a,b);case "H":return f(a.getHours(),d);case "h":return b.shortMonths[a.getMonth()];case "I":return f(l(a), -d);case "j":return d=new Date(a.getFullYear(),0,1),d=Math.ceil((a.getTime()-d.getTime())/864E5),f(d,3);case "k":return f(a.getHours(),d==null?" ":d);case "L":return f(Math.floor(i%1E3),3);case "l":return f(l(a),d==null?" ":d);case "M":return f(a.getMinutes(),d);case "m":return f(a.getMonth()+1,d);case "n":return"\n";case "o":return String(a.getDate())+s(a.getDate());case "P":return a.getHours()<12?b.am:b.pm;case "p":return a.getHours()<12?b.AM:b.PM;case "R":return g(b.formats.R||"%H:%M",a,b);case "r":return g(b.formats.r|| -"%I:%M:%S %p",a,b);case "S":return f(a.getSeconds(),d);case "s":return Math.floor(i/1E3);case "T":return g(b.formats.T||"%H:%M:%S",a,b);case "t":return"\t";case "U":return f(m(a,"sunday"),d);case "u":return d=a.getDay(),d==0?7:d;case "v":return g(b.formats.v||"%e-%b-%Y",a,b);case "W":return f(m(a,"monday"),d);case "w":return a.getDay();case "Y":return a.getFullYear();case "y":return d=String(a.getFullYear()),d.slice(d.length-2);case "Z":return j.utc?"GMT":(d=a.toString().match(/\(([\w\s]+)\)/))&& -d[1]||"";case "z":return j.utc?"+0000":(d=typeof h=="number"?h:-a.getTimezoneOffset(),(d<0?"-":"+")+f(Math.floor(Math.abs(d)/60))+f(Math.abs(d)%60));default:return e}})}function p(c){var a=(c.getTimezoneOffset()||0)*6E4;return new Date(c.getTime()+a)}function n(c){for(var a=0,b=k.length,a=0;a12&&(c-=12);return c}function s(c){var a=c%10;c%=100;if(c>=11&&c<=13||a===0||a>=4)return"th";switch(a){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function m(c,a){var a=a||"sunday",b=c.getDay();a=="monday"&&(b==0?b=6:b--);var e=new Date(c.getFullYear(),0,1);return Math.floor(((c-e)/864E5+7-b)/7)}var e;e=typeof module!=="undefined"?module.exports=i:function(){return this||(0,eval)("this")}();var o={days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "), -months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm"};e.strftime=i;e.strftimeTZ=i.strftimeTZ=function(c,a,b,e){if((typeof b=="number"||typeof b=="string")&&e==null)e=b,b=void 0;return g(c,a,b,{timezone:e})};e.strftimeUTC=i.strftimeUTC=function(c,a,b){return g(c,a,b,{utc:!0})};e.localizedStrftime=i.localizedStrftime=function(c){return function(a, -b){return g(a,b,c)}};var k=["getTime","getTimezoneOffset","getDay","getDate","getMonth","getFullYear","getYear","getHours","getMinutes","getSeconds"]})(); +(function(){function k(c,a,b){return h(c,a,b)}function h(c,a,b,l){l=l||{};a&&!p(a)&&(b=a,a=void 0);a=a||new Date;b=b||q;b.formats=b.formats||{};var k=a.getTime(),i=l.timezone,d=typeof i;if(l.utc||d=="number"||d=="string")a=r(a);if(i){if(d=="string")var m=i[0]=="-"?-1:1,s=parseInt(i.slice(1,3),10),t=parseInt(i.slice(3,5),10),i=m*(60*s+t);d&&(a=new Date(a.getTime()+i*6E4))}return c.replace(/%([-_0:]?.)/g,function(c,d){var j,e,g;if(d.length==2){j=d[0];if(j=="-")e="";else if(j=="_")e=" ";else if(j=="0")e= +"0";else if(j==":")g=!0;else return c;d=d[1]}switch(d){case "A":return b.days[a.getDay()];case "a":return b.shortDays[a.getDay()];case "B":return b.months[a.getMonth()];case "b":return b.shortMonths[a.getMonth()];case "C":return f(Math.floor(a.getFullYear()/100),e);case "D":return h(b.formats.D||"%m/%d/%y",a,b);case "d":return f(a.getDate(),e);case "e":return f(a.getDate(),e==null?" ":e);case "F":return h(b.formats.F||"%Y-%m-%d",a,b);case "H":return f(a.getHours(),e);case "h":return b.shortMonths[a.getMonth()]; +case "I":return f(n(a),e);case "j":return g=new Date(a.getFullYear(),0,1),g=Math.ceil((a.getTime()-g.getTime())/864E5),f(g,3);case "k":return f(a.getHours(),e==null?" ":e);case "L":return f(Math.floor(k%1E3),3);case "l":return f(n(a),e==null?" ":e);case "M":return f(a.getMinutes(),e);case "m":return f(a.getMonth()+1,e);case "n":return"\n";case "o":return String(a.getDate())+u(a.getDate());case "P":return a.getHours()<12?b.am:b.pm;case "p":return a.getHours()<12?b.AM:b.PM;case "R":return h(b.formats.R|| +"%H:%M",a,b);case "r":return h(b.formats.r||"%I:%M:%S %p",a,b);case "S":return f(a.getSeconds(),e);case "s":return Math.floor(k/1E3);case "T":return h(b.formats.T||"%H:%M:%S",a,b);case "t":return"\t";case "U":return f(o(a,"sunday"),e);case "u":return g=a.getDay(),g==0?7:g;case "v":return h(b.formats.v||"%e-%b-%Y",a,b);case "W":return f(o(a,"monday"),e);case "w":return a.getDay();case "Y":return a.getFullYear();case "y":return g=String(a.getFullYear()),g.slice(g.length-2);case "Z":return l.utc?"GMT": +(g=a.toString().match(/\(([\w\s]+)\)/))&&g[1]||"";case "z":return l.utc?g?"+00:00":"+0000":(j=typeof i=="number"?i:-a.getTimezoneOffset(),(j<0?"-":"+")+f(Math.floor(Math.abs(j)/60))+(g?":":"")+f(Math.abs(j)%60));default:return d}})}function r(c){var a=c.getUTCFullYear(),c=new Date(a,c.getUTCMonth(),c.getUTCDate(),c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds());c.getFullYear()!=a&&c.setFullYear(a);return c}function p(c){for(var a=0,b=m.length,a=0;a12&&(c-=12);return c}function u(c){var a=c%10;c%=100;if(c>=11&&c<=13||a===0||a>=4)return"th";switch(a){case 1:return"st";case 2:return"nd";case 3:return"rd"}}function o(c,a){var a=a||"sunday",b=c.getDay();a=="monday"&&(b==0?b=6:b--);var d=new Date(c.getFullYear(),0,1);return Math.floor(((c-d)/864E5+7-b)/7)} +var d;d=typeof module!=="undefined"?module.exports=k:function(){return this||(0,eval)("this")}();var q={days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),AM:"AM",PM:"PM",am:"am",pm:"pm"};d.strftime=k;d.strftimeTZ=k.strftimeTZ=function(c,a,b,d){if((typeof b== +"number"||typeof b=="string")&&d==null)d=b,b=void 0;return h(c,a,b,{timezone:d})};d.strftimeUTC=k.strftimeUTC=function(c,a,b){return h(c,a,b,{utc:!0})};d.localizedStrftime=k.localizedStrftime=function(c){return function(a,b){return h(a,b,c)}};var m=["getTime","getTimezoneOffset","getDay","getDate","getMonth","getFullYear","getYear","getHours","getMinutes","getSeconds"]})();