From 9f12e72d647a401b18b76914ae728ffdf9f4fa43 Mon Sep 17 00:00:00 2001 From: Iskren Chernev Date: Sat, 12 Apr 2014 09:57:12 -0700 Subject: [PATCH] Bump version to 0.0.4 --- README.md | 9 +++++++++ bower.json | 2 +- min/moment-timezone.min.js | 2 +- package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c2da10b5..cf3ce9c7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,15 @@ grunt test ## changelog +### 0.0.4 +* [#39](https://github.com/moment/moment-timezone/issues/39) improve performance with memoize +* [#46](https://github.com/moment/moment-timezone/issues/46) publish only necessary files to npm +* [#53](https://github.com/moment/moment-timezone/issues/53), [#61](https://github.com/moment/moment-timezone/issues/61), [#70](https://github.com/moment/moment-timezone/issues/70), better handling of timezones around DST +* [#41](https://github.com/moment/moment-timezone/issues/41) support browserify +* [#71](https://github.com/moment/moment-timezone/issues/71) fix cloning zone-d moments +* [#73](https://github.com/moment/moment-timezone/issues/73) add moment.tz.zoneExists method +* [#74](https://github.com/moment/moment-timezone/issues/74) prevent double loading + ### 0.0.3 * added bower support * support newer versions of moment diff --git a/bower.json b/bower.json index 6032578e..e8e1f8fb 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "moment-timezone", - "version": "0.0.3", + "version": "0.0.4", "main": "index.js", "ignore": [ "**/.*", diff --git a/min/moment-timezone.min.js b/min/moment-timezone.min.js index 4aef5349..da53f08c 100644 --- a/min/moment-timezone.min.js +++ b/min/moment-timezone.min.js @@ -1 +1 @@ -(function(){function t(t){function n(t){t+="";var e=t.split(":"),n=~t.indexOf("-")?-1:1,s=Math.abs(+e[0]),r=parseInt(e[1],10)||0,i=parseInt(e[2],10)||0;return n*(60*s+r+i/60)}function s(t,e,s,r,i,u,a,o,h,f){this.name=t,this.startYear=+e,this.endYear=+s,this.month=+r,this.day=+i,this.dayRule=+u,this.time=n(a),this.timeRule=+o,this.offset=n(h),this.letters=f||""}function r(t,e){this.rule=e,this.start=e.start(t)}function i(t,e){return t.isLast?-1:e.isLast?1:e.start-t.start}function u(t){this.name=t,this.rules=[]}function a(e,s,r,i,u,a){var o,h="string"==typeof u?u.split("_"):[9999];for(this.name=e,this.offset=n(s),this.ruleSet=r,this.letters=i,o=0;h.length>o;o++)h[o]=+h[o];this.until=t.utc(h).subtract("m",n(a))}function o(t,e){return t.until-e.until}function h(t){this.name=d(t),this.displayName=t,this.zones=[]}function f(t){var e,n,s;for(e in t)for(s=t[e],n=0;s.length>n;n++)l(e+" "+s[n])}function l(t){if(Y[t])return Y[t];var e=t.split(/\s/),n=d(e[0]),r=new s(n,e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10]);return Y[t]=r,z(n).add(r),r}function d(t){return(t||"").toLowerCase().replace(/\//g,"_")}function c(t){var e,n,s;for(e in t)for(s=t[e],n=0;s.length>n;n++)p(e+" "+s[n])}function m(t){var e;for(e in t)k[d(e)]=d(t[e])}function p(t){if(M[t])return M[t];var e=t.split(/\s/),n=d(e[0]),s=new a(n,e[1],z(e[2]),e[3],e[4],e[5]);return M[t]=s,y(e[0]).add(s),s}function z(t){return t=d(t),b[t]||(b[t]=new u(t)),b[t]}function y(t){var e=d(t);return k[e]&&(e=k[e]),A[e]||(A[e]=new h(t)),A[e]}function v(t){t&&(t.zones&&c(t.zones),t.rules&&f(t.rules),t.links&&m(t.links))}function R(){var t,e=[];for(t in A)e.push(A[t]);return e}var w,_=t.fn.zoneName,g=t.fn.zoneAbbr,Y={},b={},M={},A={},k={},L=1,N=2,q=7,x=8;return s.prototype={contains:function(t){return t>=this.startYear&&this.endYear>=t},start:function(e){return e=Math.min(Math.max(e,this.startYear),this.endYear),t.utc([e,this.month,this.date(e),0,this.time])},date:function(t){return this.dayRule===q?this.day:this.dayRule===x?this.lastWeekday(t):this.weekdayAfter(t)},weekdayAfter:function(e){for(var n=this.day,s=t([e,this.month,1]).day(),r=this.dayRule+1-s;n>r;)r+=7;return r},lastWeekday:function(e){var n=this.day,s=n%7,r=t([e,this.month+1,1]).day(),i=t([e,this.month,1]).daysInMonth(),u=i+(s-(r-1))-7*~~(n/7);return s>=r&&(u-=7),u}},r.prototype={equals:function(t){return t&&t.rule===this.rule?864e5>Math.abs(t.start-this.start):!1}},u.prototype={add:function(t){this.rules.push(t)},ruleYears:function(t,e){var n,s,u,a=t.year(),o=[];for(n=0;this.rules.length>n;n++)s=this.rules[n],s.contains(a)?o.push(new r(a,s)):s.contains(a+1)&&o.push(new r(a+1,s));return o.push(new r(a-1,this.lastYearRule(a-1))),e&&(u=new r(a-1,e.lastRule()),u.start=e.until.clone().utc(),u.isLast=e.ruleSet!==this,o.push(u)),o.sort(i),o},rule:function(t,e,n){var s,r,i,u,a,o=this.ruleYears(t,n),h=0;for(n&&(r=n.offset+n.lastRule().offset,i=9e4*Math.abs(r)),a=o.length-1;a>-1;a--)u=s,s=o[a],s.equals(u)||(n&&!s.isLast&&i>=Math.abs(s.start-n.until)&&(h+=r-e),s.rule.timeRule===N&&(h=e),s.rule.timeRule!==L&&s.start.add("m",-h),h=s.rule.offset+e);for(a=0;o.length>a;a++)if(s=o[a],t>=s.start&&!s.isLast)return s.rule;return w},lastYearRule:function(t){var e,n,s,r=w,i=-1e30;for(e=0;this.rules.length>e;e++)n=this.rules[e],t>=n.startYear&&(s=n.start(t),s>i&&(i=s,r=n));return r}},a.prototype={rule:function(t,e){return this.ruleSet.rule(t,this.offset,e)},lastRule:function(){return this._lastRule||(this._lastRule=this.rule(this.until)),this._lastRule},format:function(t){return this.letters.replace("%s",t.letters)}},h.prototype={zoneAndRule:function(t){var e,n,s;for(t=t.clone().utc(),e=0;this.zones.length>e&&(n=this.zones[e],!(n.until>t));e++)s=n;return[n,n.rule(t,s)]},add:function(t){this.zones.push(t),this.zones.sort(o)},format:function(t){var e=this.zoneAndRule(t);return e[0].format(e[1])},offset:function(t){var e=this.zoneAndRule(t);return-(e[0].offset+e[1].offset)}},t.updateOffset=function(t){var e;t._z&&(e=t._z.offset(t),16>Math.abs(e)&&(e/=60),t.zone(e))},t.fn.tz=function(e){return e?(this._z=y(e),this._z&&t.updateOffset(this),this):this._z?this._z.displayName:void 0},t.fn.zoneName=function(){return this._z?this._z.format(this):_.call(this)},t.fn.zoneAbbr=function(){return this._z?this._z.format(this):g.call(this)},t.tz=function(){var e,n=[],s=arguments.length-1;for(e=0;s>e;e++)n[e]=arguments[e];var r=t.apply(null,n),i=r.zone();return r.tz(arguments[s]),r.add("minutes",r.zone()-i)},t.tz.add=v,t.tz.addRule=l,t.tz.addZone=p,t.tz.zones=R,t.tz.version=e,w=l("- 0 9999 0 0 0 0 0 0"),t}var e="0.0.3";"function"==typeof define&&define.amd?define("moment-timezone",["moment"],t):"undefined"!=typeof window&&window.moment?t(window.moment):"undefined"!=typeof module&&(module.exports=t(require("moment")))}).apply(this); \ No newline at end of file +(function(){function a(a){function c(a){a+="";var b=a.split(":"),c=~a.indexOf("-")?-1:1,d=Math.abs(+b[0]),e=parseInt(b[1],10)||0,f=parseInt(b[2],10)||0;return c*(60*d+e+f/60)}function d(a,b,d,e,f,g,h,i,j,l){this.name=a,this.startYear=+b,this.endYear=+d,this.month=+e,this.day=+f,this.dayRule=+g,this.time=c(h),this.timeRule=+i,this.offset=c(j),this.letters=l||"",this.date=k(this.date),this.weekdayAfter=k(this.weekdayAfter),this.lastWeekday=k(this.lastWeekday)}function e(a,b){this.rule=b,this.start=b.start(a)}function f(a,b){return a.isLast?-1:b.isLast?1:b.start-a.start}function g(a){this.name=a,this.rules=[],this.lastYearRule=k(this.lastYearRule)}function h(b,d,e,f,g,h){var i,j="string"==typeof g?g.split("_"):[9999];for(this.name=b,this.offset=c(d),this.ruleSet=e,this.letters=f,this.lastRule=k(this.lastRule),i=0;i=this.startYear&&a<=this.endYear},start:function(b){return b=Math.min(Math.max(b,this.startYear),this.endYear),a.utc([b,this.month,this.date(b),0,this.time])},date:function(a){return this.dayRule===F?this.day:this.dayRule===G?this.lastWeekday(a):this.weekdayAfter(a)},weekdayAfter:function(b){for(var c=this.day,d=a([b,this.month,1]).day(),e=this.dayRule+1-d;c>e;)e+=7;return e},lastWeekday:function(b){var c=this.day,d=c%7,e=a([b,this.month+1,1]).day(),f=a([b,this.month,1]).daysInMonth(),g=f+(d-(e-1))-7*~~(c/7);return d>=e&&(g-=7),g}},e.prototype={equals:function(a){return a&&a.rule===this.rule?Math.abs(a.start-this.start)<864e5:!1}},g.prototype={add:function(a){this.rules.push(a)},ruleYears:function(a,b){var c,d,g,h=a.year(),i=[];for(c=0;c-1;h--)g=d,d=i[h],d.equals(g)||(c&&!d.isLast&&Math.abs(d.start-c.until)<=f&&(j+=e-b),d.rule.timeRule===E&&(j=b),d.rule.timeRule!==D&&d.start.add("m",-j),j=d.rule.offset+b);for(h=0;h=d.start&&!d.isLast)return d.rule;return v},lastYearRule:function(a){var b,c,d,e=v,f=-1e30;for(b=0;b=c.startYear&&(d=c.start(a),d>f&&(f=d,e=c));return e}},h.prototype={rule:function(a,b){return this.ruleSet.rule(a,this.offset,b)},lastRule:function(){return this.rule(this.until)},format:function(a){return this.letters.replace("%s",a.letters)}},j.prototype={zoneAndRule:function(a){var b,c,d;for(a=a.clone().utc(),b=0;bb;b++)c[b]=arguments[b];var e=a.apply(null,c),f=e.zone();return e.tz(arguments[d]),e.add("minutes",e.zone()-f)},a.tz.add=t,a.tz.addRule=m,a.tz.addZone=q,a.tz.zones=u,a.tz.version=b,a.tz.zoneExists=function(a){return s(a).zones.length>0},v=m("- 0 9999 0 0 0 0 0 0"),a}var b="0.0.3";"function"==typeof define&&define.amd?define("moment-timezone",["moment"],a):"undefined"!=typeof module?module.exports=a(require("moment")):"undefined"!=typeof window&&window.moment&&a(window.moment)}).apply(this); \ No newline at end of file diff --git a/package.json b/package.json index 1b57ccb1..467b109d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moment-timezone", - "version": "0.0.3", + "version": "0.0.4", "description": "Timezone plugin for Moment.js.", "homepage": "http://momentjs.com", "author": "Tim Wood (http://timwoodcreates.com/)",