Socket
Socket
Sign inDemoInstall

moment-timezone

Package Overview
Dependencies
1
Maintainers
2
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 0.0.6

2

bower.json
{
"name": "moment-timezone",
"version": "0.0.5",
"version": "0.0.6",
"main": "index.js",

@@ -5,0 +5,0 @@ "ignore": [

@@ -1,1 +0,1 @@

(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<j.length;i++)j[i]=+j[i];this.until=a.utc(j).subtract("m",c(h))}function i(a,b){return a.until-b.until}function j(a){this.name=n(a),this.displayName=a,this.zones=[],this.zoneAndRule=k(this.zoneAndRule,function(a){return+a})}function k(a,b){var c={};return function(d){var e=b?b.apply(this,arguments):d;return e in c?c[e]:c[e]=a.apply(this,arguments)}}function l(a){var b,c,d;for(b in a)for(d=a[b],c=0;c<d.length;c++)m(b+" "+d[c])}function m(a){if(y[a])return y[a];var b=a.split(/\s/),c=n(b[0]),e=new d(c,b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10]);return y[a]=e,r(c).add(e),e}function n(a){return(a||"").toLowerCase().replace(/\//g,"_")}function o(a){var b,c,d;for(b in a)for(d=a[b],c=0;c<d.length;c++)q(b+" "+d[c])}function p(a){var b;for(b in a)C[n(b)]=n(a[b])}function q(a){if(A[a])return A[a];var b=a.split(/\s/),c=n(b[0]),d=new h(c,b[1],r(b[2]),b[3],b[4],b[5]);return A[a]=d,s(b[0]).add(d),d}function r(a){return a=n(a),z[a]||(z[a]=new g(a)),z[a]}function s(a){var b=n(a);return C[b]&&(b=C[b]),B[b]||(B[b]=new j(a)),B[b]}function t(a){a&&(a.zones&&o(a.zones),a.rules&&l(a.rules),a.links&&p(a.links))}function u(){var a,b=[];for(a in B)b.push(B[a]);return b}var v,w=a.fn.zoneName,x=a.fn.zoneAbbr,y={},z={},A={},B={},C={},D=1,E=2,F=7,G=8;if(void 0===a.tz)return d.prototype={contains:function(a){return a>=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<this.rules.length;c++)d=this.rules[c],d.contains(h)?i.push(new e(h,d)):d.contains(h+1)&&i.push(new e(h+1,d));return i.push(new e(h-1,this.lastYearRule(h-1))),b&&(g=new e(h-1,b.lastRule()),g.start=b.until.clone().utc(),g.isLast=b.ruleSet!==this,i.push(g)),i.sort(f),i},rule:function(a,b,c){var d,e,f,g,h,i=this.ruleYears(a,c),j=0;for(c&&(e=c.offset+c.lastRule().offset,f=9e4*Math.abs(e)),h=i.length-1;h>-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<i.length;h++)if(d=i[h],a>=d.start&&!d.isLast)return d.rule;return v},lastYearRule:function(a){var b,c,d,e=v,f=-1e30;for(b=0;b<this.rules.length;b++)c=this.rules[b],a>=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;b<this.zones.length&&(c=this.zones[b],!(a<c.until));b++)d=c;return[c,c.rule(a,d)]},add:function(a){this.zones.push(a),this.zones.sort(i)},format:function(a){var b=this.zoneAndRule(a);return b[0].format(b[1])},offset:function(a){var b=this.zoneAndRule(a);return-(b[0].offset+b[1].offset)}},a.updateOffset=function(a,b){var c;a._z&&(c=a._z.offset(a),Math.abs(c)<16&&(c/=60),a.zone(c,b))},a.fn.tz=function(b){return b?(this._z=s(b),this._z&&a.updateOffset(this),this):this._z?this._z.displayName:void 0},a.fn.zoneName=function(){return this._z?this._z.format(this):w.call(this)},a.fn.zoneAbbr=function(){return this._z?this._z.format(this):x.call(this)},a.momentProperties._z=null,a.tz=function(){var b,c=[],d=arguments.length-1;for(b=0;d>b;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.5";"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);
(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<j.length;i++)j[i]=+j[i];this.until=a.utc(j).subtract("m",c(h))}function i(a,b){return a.until-b.until}function j(a){this.name=n(a),this.displayName=a,this.zones=[],this.zoneAndRule=k(this.zoneAndRule,function(a){return+a})}function k(a,b){var c={};return function(d){var e=b?b.apply(this,arguments):d;return e in c?c[e]:c[e]=a.apply(this,arguments)}}function l(a){var b,c,d;for(b in a)for(d=a[b],c=0;c<d.length;c++)m(b+" "+d[c])}function m(a){if(y[a])return y[a];var b=a.split(/\s/),c=n(b[0]),e=new d(c,b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10]);return y[a]=e,r(c).add(e),e}function n(a){return(a||"").toLowerCase().replace(/\//g,"_")}function o(a){var b,c,d;for(b in a)for(d=a[b],c=0;c<d.length;c++)q(b+" "+d[c])}function p(a){var b;for(b in a)C[n(b)]=n(a[b])}function q(a){if(A[a])return A[a];var b=a.split(/\s/),c=n(b[0]),d=new h(c,b[1],r(b[2]),b[3],b[4],b[5]);return A[a]=d,s(b[0]).add(d),d}function r(a){return a=n(a),z[a]||(z[a]=new g(a)),z[a]}function s(a){var b=n(a);return C[b]&&(b=C[b]),B[b]||(B[b]=new j(a)),B[b]}function t(a){a&&(a.zones&&o(a.zones),a.rules&&l(a.rules),a.links&&p(a.links))}function u(){var a,b=[];for(a in B)b.push(B[a]);return b}var v,w=a.fn.zoneName,x=a.fn.zoneAbbr,y={},z={},A={},B={},C={},D=1,E=2,F=7,G=8;return void 0!==a.tz?a:(d.prototype={contains:function(a){return a>=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<this.rules.length;c++)d=this.rules[c],d.contains(h)?i.push(new e(h,d)):d.contains(h+1)&&i.push(new e(h+1,d));return i.push(new e(h-1,this.lastYearRule(h-1))),b&&(g=new e(h-1,b.lastRule()),g.start=b.until.clone().utc(),g.isLast=b.ruleSet!==this,i.push(g)),i.sort(f),i},rule:function(a,b,c){var d,e,f,g,h,i=this.ruleYears(a,c),j=0;for(c&&(e=c.offset+c.lastRule().offset,f=9e4*Math.abs(e)),h=i.length-1;h>-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<i.length;h++)if(d=i[h],a>=d.start&&!d.isLast)return d.rule;return v},lastYearRule:function(a){var b,c,d,e=v,f=-1e30;for(b=0;b<this.rules.length;b++)c=this.rules[b],a>=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;b<this.zones.length&&(c=this.zones[b],!(a<c.until));b++)d=c;return[c,c.rule(a,d)]},add:function(a){this.zones.push(a),this.zones.sort(i)},format:function(a){var b=this.zoneAndRule(a);return b[0].format(b[1])},offset:function(a){var b=this.zoneAndRule(a);return-(b[0].offset+b[1].offset)}},a.updateOffset=function(a,b){var c;a._z&&(c=a._z.offset(a),Math.abs(c)<16&&(c/=60),a.zone(c,b))},a.fn.tz=function(b){return b?(this._z=s(b),this._z&&a.updateOffset(this),this):this._z?this._z.displayName:void 0},a.fn.zoneName=function(){return this._z?this._z.format(this):w.call(this)},a.fn.zoneAbbr=function(){return this._z?this._z.format(this):x.call(this)},a.momentProperties._z=null,a.tz=function(){var b,c=[],d=arguments.length-1;for(b=0;d>b;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.6";"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);
// moment-timezone.js
// version : 0.0.5
// version : 0.0.6
// author : Tim Wood

@@ -9,3 +9,3 @@ // license : MIT

var VERSION = "0.0.5";
var VERSION = "0.0.6";

@@ -32,3 +32,3 @@ function onload(moment) {

// Do not load moment-timezone a second time.
return;
return moment;
}

@@ -35,0 +35,0 @@

{
"name": "moment-timezone",
"version": "0.0.5",
"version": "0.0.6",
"description": "Timezone plugin for Moment.js.",

@@ -5,0 +5,0 @@ "homepage": "http://momentjs.com",

@@ -35,3 +35,6 @@ moment-timezone

### 0.0.4
### 0.0.6
* fix double loading issue introduced in 0.0.5
### 0.0.5
* [#39](https://github.com/moment/moment-timezone/issues/39) improve performance with memoize

@@ -38,0 +41,0 @@ * [#46](https://github.com/moment/moment-timezone/issues/46) publish only necessary files to npm

@@ -40,3 +40,3 @@ var moment = require("../index");

t.equal(
moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').month("April").format(),
moment("2014-03-09T00:00:00-08:00").tz('America/Los_Angeles').month(3).format(),
"2014-04-09T00:00:00-07:00",

@@ -43,0 +43,0 @@ "setting month across a DST boundary should not affect time (PST -> PDT).");

@@ -13,2 +13,2 @@ moment = require('../index');

}
}
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc