Comparing version 2.3.4 to 2.3.5
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rrule=t():e.rrule=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPresent=function(e){return null!==e&&void 0!==e},t.isNumber=function(e){return"number"==typeof e},t.isArray=Array.isArray,t.range=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;1===arguments.length&&(t=e,e=0);for(var n=[],r=e;r<t;r++)n.push(r);return n},t.clone=function(e){return[].concat(e)},t.repeat=function(e,n){var r=0,a=[];if(t.isArray(e))for(;r<n;r++)a[r]=[].concat(e);else for(;r<n;r++)a[r]=e;return a},t.split=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},t.pymod=function(e,t){var n=e%t;return n*t<0?n+t:n},t.divmod=function(e,n){return{div:Math.floor(e/n),mod:t.pymod(e,n)}},t.empty=function(e){return!t.isPresent(e)||0===e.length},t.notEmpty=function(e){return!t.empty(e)},t.includes=function(e,n){return t.notEmpty(e)&&-1!==e.indexOf(n)}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=["MO","TU","WE","TH","FR","SA","SU"],i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),0===n)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=n}return r(e,[{key:"nth",value:function(t){return this.n===t?this:new e(this.weekday,t)}},{key:"equals",value:function(e){return this.weekday===e.weekday&&this.n===e.n}},{key:"toString",value:function(){var e=a[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e}},{key:"getJsWeekday",value:function(){return 6===this.weekday?0:this.weekday+1}}]),e}();t.default=i},function(e,t,n){"use strict";var r,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],e.ONE_DAY=864e5,e.MAXYEAR=9999,e.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),e.PY_WEEKDAYS=[6,0,1,2,3,4,5],e.getYearDay=function(t){var n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((n.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/e.ONE_DAY)+1},e.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},e.tzOffset=function(e){return 60*e.getTimezoneOffset()*1e3},e.daysBetween=function(t,n){var r=t.getTime()-e.tzOffset(t)-(n.getTime()-e.tzOffset(n));return Math.round(r/e.ONE_DAY)},e.toOrdinal=function(t){return e.daysBetween(t,e.ORDINAL_BASE)},e.fromOrdinal=function(t){return new Date(e.ORDINAL_BASE.getTime()+t*e.ONE_DAY)},e.getMonthDays=function(t){var n=t.getUTCMonth();return 1===n&&e.isLeapYear(t.getUTCFullYear())?29:e.MONTH_DAYS[n]},e.getWeekday=function(t){return e.PY_WEEKDAYS[t.getUTCDay()]},e.monthRange=function(t,n){var r=new Date(Date.UTC(t,n,1));return[e.getWeekday(r),e.getMonthDays(r)]},e.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},e.clone=function(e){return new Date(e.getTime())},e.cloneDates=function(t){for(var n=[],r=0;r<t.length;r++)n.push(e.clone(t[r]));return n},e.sort=function(e){e.sort(function(e,t){return e.getTime()-t.getTime()})},e.timeToUntilString=function(e){for(var t=void 0,n=new Date(e),r=[n.getUTCFullYear(),n.getUTCMonth()+1,n.getUTCDate(),"T",n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),"Z"],a=0;a<r.length;a++)t=r[a],!/[TZ]/.test(t.toString())&&t<10&&(r[a]="0"+String(t));return r.join("")},e.untilStringToDate=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw new Error("Invalid UNTIL value: "+e);return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))};var t=function(){function e(t,n,r,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.hour=t,this.minute=n,this.second=r,this.millisecond=a||0}return a(e,[{key:"getHours",value:function(){return this.hour}},{key:"getMinutes",value:function(){return this.minute}},{key:"getSeconds",value:function(){return this.second}},{key:"getMilliseconds",value:function(){return this.millisecond}},{key:"getTime",value:function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond}}]),e}();e.Time=t}(r=t.dateutil||(t.dateutil={})),t.default=r},function(e,t,n){"use strict";var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=n(2),u=n(9),l=n(0),d=n(7),h=n(11),y=n(5),f=n(12),c=n(13),p=function e(){return e._nlp||(e._nlp=n(14)),e._nlp};t.DEFAULT_OPTIONS={freq:y.Frequency.YEARLY,dtstart:null,interval:1,wkst:y.Days.MO,count:null,until:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},t.defaultKeys=Object.keys(t.DEFAULT_OPTIONS);var b=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._string=null,this._cache=n?null:{all:!1,before:[],after:[],between:[]},this.origOptions=f.initializeOptions(t);var r=f.parseOptions(t),a=r.parsedOptions,i=r.timeset;this.options=a,this.timeset=i}return a(e,[{key:"all",value:function(e){if(e)return this._iter(new h.default("all",{},e));var t=this._cacheGet("all");return!1===t&&(t=this._iter(new d.default("all",{})),this._cacheAdd("all",t)),t}},{key:"between",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments[3],a={before:t,after:e,inc:n};if(r)return this._iter(new h.default("between",a,r));var i=this._cacheGet("between",a);return!1===i&&(i=this._iter(new d.default("between",a)),this._cacheAdd("between",i,a)),i}},{key:"before",value:function(e){var t={dt:e,inc:arguments.length>1&&void 0!==arguments[1]&&arguments[1]},n=this._cacheGet("before",t);return!1===n&&(n=this._iter(new d.default("before",t)),this._cacheAdd("before",n,t)),n}},{key:"after",value:function(e){var t={dt:e,inc:arguments.length>1&&void 0!==arguments[1]&&arguments[1]},n=this._cacheGet("after",t);return!1===n&&(n=this._iter(new d.default("after",t)),this._cacheAdd("after",n,t)),n}},{key:"count",value:function(){return this.all().length}},{key:"toString",value:function(){return e.optionsToString(this.origOptions)}},{key:"toText",value:function(e,t){return p().toText(this,e,t)}},{key:"isFullyConvertibleToText",value:function(){return p().isFullyConvertible(this)}},{key:"_cacheAdd",value:function(e,t,n){this._cache&&(t&&(t=t instanceof Date?s.default.clone(t):s.default.cloneDates(t)),"all"===e?this._cache.all=t:(n._value=t,this._cache[e].push(n)))}},{key:"_cacheGet",value:function(e,t){if(!this._cache)return!1;var n=!1,r=t?Object.keys(t):[],a=function(e){for(var n=0;n<r.length;n++){var a=r[n];if(String(t[a])!==String(e[a]))return!0}return!1},i=this._cache[e];if("all"===e)n=this._cache.all;else if(l.isArray(i))for(var o=0;o<i.length;o++){var u=i[o];if(!r.length||!a(u)){n=u._value;break}}if(!n&&this._cache.all){for(var h=new d.default(e,t),y=0;y<this._cache.all.length&&h.accept(this._cache.all[y]);y++);n=h.getValue(),this._cacheAdd(e,n,t)}return l.isArray(n)?s.default.cloneDates(n):n instanceof Date?s.default.clone(n):n}},{key:"clone",value:function(){return new e(this.origOptions)}},{key:"_iter",value:function(t){var n,a=this.options.dtstart,o=this.options.dtstart.valueOf()%1e3,d=a.getUTCFullYear(),h=a.getUTCMonth()+1,y=a.getUTCDate(),f=a.getUTCHours(),c=a.getUTCMinutes(),p=a.getUTCSeconds(),b=s.default.getWeekday(a),v=this.options,w=v.freq,k=v.interval,g=v.wkst,E=v.until,_=v.bymonth,T=v.byweekno,O=v.byyearday,Y=v.byweekday,D=v.byeaster,S=v.bymonthday,M=v.bynmonthday,A=v.bysetpos,x=v.byhour,L=v.byminute,U=v.bysecond,N=new u.default(this);N.rebuild(d,h);var R,C=(n={},i(n,e.YEARLY,N.ydayset),i(n,e.MONTHLY,N.mdayset),i(n,e.WEEKLY,N.wdayset),i(n,e.DAILY,N.ddayset),i(n,e.HOURLY,N.ddayset),i(n,e.MINUTELY,N.ddayset),i(n,e.SECONDLY,N.ddayset),n)[w],I=void 0,P=void 0;w<e.HOURLY?I=this.timeset:(P=(R={},i(R,e.HOURLY,N.htimeset),i(R,e.MINUTELY,N.mtimeset),i(R,e.SECONDLY,N.stimeset),R)[w],I=w>=e.HOURLY&&l.notEmpty(x)&&!l.includes(x,f)||w>=e.MINUTELY&&l.notEmpty(L)&&!l.includes(L,c)||w>=e.SECONDLY&&l.notEmpty(U)&&!l.includes(U,p)?[]:P.call(N,f,c,p,o));for(var j=void 0,W=0,H=this.options.count,F=void 0,q=void 0,K=void 0,B=void 0;;){for(var V=C.call(N,d,h,y),X=r(V,3),G=X[0],Q=X[1],$=X[2],z=!1,J=Q;J<$;J++)(z=m(_,N,j=G[J],T,Y,D,S,M,O))&&(G[j]=null);if(l.notEmpty(A)&&l.notEmpty(I)){for(var Z=void 0,ee=void 0,te=[],ne=0;ne<A.length;ne++){(B=A[ne])<0?(Z=Math.floor(B/I.length),ee=l.pymod(B,I.length)):(Z=Math.floor((B-1)/I.length),ee=l.pymod(B-1,I.length));try{for(var re=[],ae=Q;ae<$;ae++){var ie=G[ae];l.isPresent(ie)&&re.push(ie)}var oe=void 0;oe=Z<0?re.slice(Z)[0]:re[Z];var se=I[ee],ue=s.default.fromOrdinal(N.yearordinal+oe),le=s.default.combine(ue,se);l.includes(te,le)||te.push(le)}catch(e){}}s.default.sort(te);for(var de=0;de<te.length;de++){var he=te[de];if(E&&he>E)return this._len=W,t.getValue();if(he>=a){if(++W,!t.accept(he))return t.getValue();if(H&&!--H)return this._len=W,t.getValue()}}}else for(var ye=Q;ye<$;ye++)if(null!==(j=G[ye]))for(var fe=s.default.fromOrdinal(N.yearordinal+j),ce=0;ce<I.length;ce++){var pe=I[ce],be=s.default.combine(fe,pe);if(E&&be>E)return this._len=W,t.getValue();if(be>=a){if(++W,!t.accept(be))return t.getValue();if(H&&!--H)return this._len=W,t.getValue()}}var me=!1;if(w===e.YEARLY){if((d+=k)>s.default.MAXYEAR)return this._len=W,t.getValue();N.rebuild(d,h)}else if(w===e.MONTHLY){if((h+=k)>12&&(d+=q=Math.floor(h/12),0===(h=K=l.pymod(h,12))&&(h=12,--d),d>s.default.MAXYEAR))return this._len=W,t.getValue();N.rebuild(d,h)}else if(w===e.WEEKLY)y+=g>b?7*k-(b+1+(6-g)):7*k-(b-g),b=g,me=!0;else if(w===e.DAILY)y+=k,me=!0;else if(w===e.HOURLY){for(z&&(f+=Math.floor((23-f)/k)*k);f+=k,q=(F=l.divmod(f,24)).div,K=F.mod,q&&(f=K,y+=q,me=!0),!l.empty(x)&&!l.includes(x,f););I=P.call(N,f,c,p)}else if(w===e.MINUTELY){for(z&&(c+=Math.floor((1439-(60*f+c))/k)*k);c+=k,q=(F=l.divmod(c,60)).div,K=F.mod,q&&(c=K,f+=q,q=(F=l.divmod(f,24)).div,K=F.mod,q&&(f=K,y+=q,me=!0,z=!1)),!l.empty(x)&&!l.includes(x,f)||!l.empty(L)&&!l.includes(L,c););I=P.call(N,f,c,p)}else if(w===e.SECONDLY){for(z&&(p+=Math.floor((86399-(3600*f+60*c+p))/k)*k);p+=k,q=(F=l.divmod(p,60)).div,K=F.mod,q&&(p=K,c+=q,q=(F=l.divmod(c,60)).div,K=F.mod,q&&(c=K,f+=q,q=(F=l.divmod(f,24)).div,K=F.mod,q&&(f=K,y+=q,me=!0))),!l.empty(x)&&!l.includes(x,f)||!l.empty(L)&&!l.includes(L,c)||!l.empty(U)&&!l.includes(U,p););I=P.call(N,f,c,p)}if(me&&y>28){var ve=s.default.monthRange(d,h-1)[1];if(y>ve){for(;y>ve;){if(y-=ve,13===++h&&(h=1,++d>s.default.MAXYEAR))return this._len=W,t.getValue();ve=s.default.monthRange(d,h-1)[1]}N.rebuild(d,h)}}}}}],[{key:"parseText",value:function(e,t){return p().parseText(e,t)}},{key:"fromText",value:function(e,t){return p().fromText(e,t)}},{key:"parseString",value:function(e){return c.parseString(e)}},{key:"fromString",value:function(t){return new e(e.parseString(t)||void 0)}},{key:"optionsToString",value:function(n){for(var r=[],a=Object.keys(n),i=Object.keys(t.DEFAULT_OPTIONS),u=0;u<a.length;u++)if(l.includes(i,a[u])){var d=a[u].toUpperCase(),h=n[a[u]],y=[];if(l.isPresent(h)&&(!l.isArray(h)||h.length)){switch(d){case"FREQ":h=e.FREQUENCIES[n.freq];break;case"WKST":l.isNumber(h)&&(h=new o.default(h));break;case"BYWEEKDAY":d="BYDAY",l.isArray(h)||(h=[h]);for(var f=0;f<h.length;f++){var c=h[f];c instanceof o.default||(c=l.isArray(c)?new o.default(c[0],c[1]):new o.default(c)),y[f]=c.toString()}h=y;break;case"DTSTART":case"UNTIL":h=s.default.timeToUntilString(h);break;default:if(l.isArray(h)){for(var p=0;p<h.length;p++)y[p]=String(h[p]);h=y}else h=String(h)}r.push([d,h])}}for(var b=[],m=0;m<r.length;m++){var v=r[m];b.push(v[0]+"="+v[1].toString())}return b.join(";")}}]),e}();function m(e,t,n,r,a,i,o,s,u){return l.notEmpty(e)&&!l.includes(e,t.mmask[n])||l.notEmpty(r)&&!t.wnomask[n]||l.notEmpty(a)&&!l.includes(a,t.wdaymask[n])||l.notEmpty(t.nwdaymask)&&!t.nwdaymask[n]||null!==i&&!l.includes(t.eastermask,n)||(l.notEmpty(o)||l.notEmpty(s))&&!l.includes(o,t.mdaymask[n])&&!l.includes(s,t.nmdaymask[n])||l.notEmpty(u)&&(n<t.yearlen&&!l.includes(u,n+1)&&!l.includes(u,-t.yearlen+n)||n>=t.yearlen&&!l.includes(u,n+1-t.yearlen)&&!l.includes(u,-t.nextyearlen+n-t.yearlen))}b.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],b.YEARLY=y.Frequency.YEARLY,b.MONTHLY=y.Frequency.MONTHLY,b.WEEKLY=y.Frequency.WEEKLY,b.DAILY=y.Frequency.DAILY,b.HOURLY=y.Frequency.HOURLY,b.MINUTELY=y.Frequency.MINUTELY,b.SECONDLY=y.Frequency.SECONDLY,b.MO=y.Days.MO,b.TU=y.Days.TU,b.WE=y.Days.WE,b.TH=y.Days.TH,b.FR=y.Days.FR,b.SA=y.Days.SA,b.SU=y.Days.SU,t.default=b},function(e,t,n){"use strict"; | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.rrule=t():e.rrule=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPresent=function(e){return null!==e&&void 0!==e},t.isNumber=function(e){return"number"==typeof e},t.isArray=Array.isArray,t.range=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;1===arguments.length&&(t=e,e=0);for(var n=[],r=e;r<t;r++)n.push(r);return n},t.clone=function(e){return[].concat(e)},t.repeat=function(e,n){var r=0,a=[];if(t.isArray(e))for(;r<n;r++)a[r]=[].concat(e);else for(;r<n;r++)a[r]=e;return a},t.padStart=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:" ";return n>>=0,e.length>n?String(e):((n-=e.length)>r.length&&(r+=t.repeat(r,n/r.length)),r.slice(0,n)+String(e))},t.split=function(e,t,n){var r=e.split(t);return n?r.slice(0,n).concat([r.slice(n).join(t)]):r},t.pymod=function(e,t){var n=e%t;return n*t<0?n+t:n},t.divmod=function(e,n){return{div:Math.floor(e/n),mod:t.pymod(e,n)}},t.empty=function(e){return!t.isPresent(e)||0===e.length},t.notEmpty=function(e){return!t.empty(e)},t.includes=function(e,n){return t.notEmpty(e)&&-1!==e.indexOf(n)}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i,s=n(0);!function(e){e.MONTH_DAYS=[31,28,31,30,31,30,31,31,30,31,30,31],e.ONE_DAY=864e5,e.MAXYEAR=9999,e.ORDINAL_BASE=new Date(Date.UTC(1970,0,1)),e.PY_WEEKDAYS=[6,0,1,2,3,4,5],e.getYearDay=function(t){var n=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate());return Math.ceil((n.valueOf()-new Date(t.getUTCFullYear(),0,1).valueOf())/e.ONE_DAY)+1},e.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},e.tzOffset=function(e){return 60*e.getTimezoneOffset()*1e3},e.daysBetween=function(t,n){var r=t.getTime()-e.tzOffset(t)-(n.getTime()-e.tzOffset(n));return Math.round(r/e.ONE_DAY)},e.toOrdinal=function(t){return e.daysBetween(t,e.ORDINAL_BASE)},e.fromOrdinal=function(t){return new Date(e.ORDINAL_BASE.getTime()+t*e.ONE_DAY)},e.getMonthDays=function(t){var n=t.getUTCMonth();return 1===n&&e.isLeapYear(t.getUTCFullYear())?29:e.MONTH_DAYS[n]},e.getWeekday=function(t){return e.PY_WEEKDAYS[t.getUTCDay()]},e.monthRange=function(t,n){var r=new Date(Date.UTC(t,n,1));return[e.getWeekday(r),e.getMonthDays(r)]},e.combine=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},e.clone=function(e){return new Date(e.getTime())},e.cloneDates=function(t){for(var n=[],r=0;r<t.length;r++)n.push(e.clone(t[r]));return n},e.sort=function(e){e.sort(function(e,t){return e.getTime()-t.getTime()})},e.timeToUntilString=function(e){var t=new Date(e);return[s.padStart(t.getUTCFullYear().toString(),4,"0"),t.getUTCMonth()+1,t.getUTCDate(),"T",t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),"Z"].map(function(e){return e.toString()}).map(function(e){return/[TZ]/.test(e)?e:s.padStart(e,2,"0")}).join("")},e.untilStringToDate=function(e){var t=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/.exec(e);if(!t)throw new Error("Invalid UNTIL value: "+e);return new Date(Date.UTC(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),parseInt(t[5],10)||0,parseInt(t[6],10)||0,parseInt(t[7],10)||0))};var t=function(){function e(t,n,r,i){a(this,e),this.hour=t,this.minute=n,this.second=r,this.millisecond=i||0}return r(e,[{key:"getHours",value:function(){return this.hour}},{key:"getMinutes",value:function(){return this.minute}},{key:"getSeconds",value:function(){return this.second}},{key:"getMilliseconds",value:function(){return this.millisecond}},{key:"getTime",value:function(){return 1e3*(60*this.hour*60+60*this.minute+this.second)+this.millisecond}}]),e}();e.Time=t;var n=function(n){function i(e,t,n,r,s,o,u){a(this,i);var l=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,r,s,o,u));return l.year=e,l.month=t,l.day=n,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,t),r(i,[{key:"getWeekday",value:function(){return e.getWeekday(new Date(this.getTime()))}},{key:"getTime",value:function(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond)).getTime()}},{key:"getDay",value:function(){return this.day}},{key:"getMonth",value:function(){return this.month}},{key:"getYear",value:function(){return this.year}},{key:"addYears",value:function(e){this.year+=e}},{key:"addMonths",value:function(e){if(this.month+=e,this.month>12){var t=Math.floor(this.month/12),n=s.pymod(this.month,12);this.month=n,this.year+=t,0===this.month&&(this.month=12,--this.year)}}},{key:"addWeekly",value:function(e,t){t>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-t))+7*e:this.day+=-(this.getWeekday()-t)+7*e,this.fixDay()}},{key:"addDaily",value:function(e){this.day+=e,this.fixDay()}},{key:"addHours",value:function(e,t,n){var r=!1;for(t&&(this.hour+=Math.floor((23-this.hour)/e)*e);;){this.hour+=e;var a=s.divmod(this.hour,24),i=a.div,o=a.mod;if(i&&(this.hour=o,this.addDaily(i),r=!0),s.empty(n)||s.includes(n,this.hour))break}return r}},{key:"addMinutes",value:function(e,t,n,r){var a=!1;for(t&&(this.minute+=Math.floor((1439-(60*this.hour+this.minute))/e)*e);;){this.minute+=e;var i=s.divmod(this.minute,60),o=i.div,u=i.mod;if(o&&(this.minute=u,a=this.addHours(o,!1,n)),(s.empty(n)||s.includes(n,this.hour))&&(s.empty(r)||s.includes(r,this.minute)))break}return a}},{key:"addSeconds",value:function(e,t,n,r,a){var i=!1;for(t&&(this.second+=Math.floor((86399-(3600*this.hour+60*this.minute+this.second))/e)*e);;){this.second+=e;var o=s.divmod(this.second,60),u=o.div,l=o.mod;if(u&&(this.second=l,i=this.addMinutes(u,!1,n,r)),(s.empty(n)||s.includes(n,this.hour))&&(s.empty(r)||s.includes(r,this.minute))&&(s.empty(a)||s.includes(a,this.second)))break}return i}},{key:"fixDay",value:function(){if(!(this.day<=28)){var t=e.monthRange(this.year,this.month-1)[1];if(!(this.day<=t))for(;this.day>t;){if(this.day-=t,++this.month,13===this.month&&(this.month=1,++this.year,this.year>e.MAXYEAR))return;t=e.monthRange(this.year,this.month-1)[1]}}}}]),i}();e.DateTime=n}(i=t.dateutil||(t.dateutil={})),t.default=i},function(e,t,n){"use strict";var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),o=n(9),u=n(0),l=n(5),h=n(11),d=n(6),y=n(12),f=n(13),c=n(14),p=n(15),b=function e(){return e._nlp||(e._nlp=n(16)),e._nlp};t.DEFAULT_OPTIONS={freq:d.Frequency.YEARLY,dtstart:null,interval:1,wkst:d.Days.MO,count:null,until:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},t.defaultKeys=Object.keys(t.DEFAULT_OPTIONS);var m=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._string=null,this._cache=n?null:new p.Cache,this.origOptions=y.initializeOptions(t);var r=y.parseOptions(t),a=r.parsedOptions,i=r.timeset;this.options=a,this.timeset=i}return a(e,[{key:"_cacheGet",value:function(e,t){return!!this._cache&&this._cache._cacheGet(e,t)}},{key:"_cacheAdd",value:function(e,t,n){if(this._cache)return this._cache._cacheAdd(e,t,n)}},{key:"all",value:function(e){if(e)return this._iter(new h.default("all",{},e));var t=this._cacheGet("all");return!1===t&&(t=this._iter(new l.default("all",{})),this._cacheAdd("all",t)),t}},{key:"between",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments[3],a={before:t,after:e,inc:n};if(r)return this._iter(new h.default("between",a,r));var i=this._cacheGet("between",a);return!1===i&&(i=this._iter(new l.default("between",a)),this._cacheAdd("between",i,a)),i}},{key:"before",value:function(e){var t={dt:e,inc:arguments.length>1&&void 0!==arguments[1]&&arguments[1]},n=this._cacheGet("before",t);return!1===n&&(n=this._iter(new l.default("before",t)),this._cacheAdd("before",n,t)),n}},{key:"after",value:function(e){var t={dt:e,inc:arguments.length>1&&void 0!==arguments[1]&&arguments[1]},n=this._cacheGet("after",t);return!1===n&&(n=this._iter(new l.default("after",t)),this._cacheAdd("after",n,t)),n}},{key:"count",value:function(){return this.all().length}},{key:"toString",value:function(){return c.optionsToString(this.origOptions)}},{key:"toText",value:function(e,t){return b().toText(this,e,t)}},{key:"isFullyConvertibleToText",value:function(){return b().isFullyConvertible(this)}},{key:"clone",value:function(){return new e(this.origOptions)}},{key:"_iter",value:function(t){var n,a=this.options.dtstart,l=new s.default.DateTime(a.getUTCFullYear(),a.getUTCMonth()+1,a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.valueOf()%1e3),h=this.options,d=h.freq,y=h.interval,f=h.wkst,c=h.until,p=h.bymonth,b=h.byweekno,m=h.byyearday,w=h.byweekday,k=h.byeaster,g=h.bymonthday,E=h.bynmonthday,_=h.bysetpos,T=h.byhour,O=h.byminute,Y=h.bysecond,D=new o.default(this);D.rebuild(l.year,l.month);var S,M=(n={},i(n,e.YEARLY,D.ydayset),i(n,e.MONTHLY,D.mdayset),i(n,e.WEEKLY,D.wdayset),i(n,e.DAILY,D.ddayset),i(n,e.HOURLY,D.ddayset),i(n,e.MINUTELY,D.ddayset),i(n,e.SECONDLY,D.ddayset),n)[d],x=void 0,A=void 0;d<e.HOURLY?x=this.timeset:(A=(S={},i(S,e.HOURLY,D.htimeset),i(S,e.MINUTELY,D.mtimeset),i(S,e.SECONDLY,D.stimeset),S)[d],x=d>=e.HOURLY&&u.notEmpty(T)&&!u.includes(T,l.hour)||d>=e.MINUTELY&&u.notEmpty(O)&&!u.includes(O,l.minute)||d>=e.SECONDLY&&u.notEmpty(Y)&&!u.includes(Y,l.second)?[]:A.call(D,l.hour,l.minute,l.second,l.millisecond));for(var L=void 0,U=this.options.count,N=void 0;;){for(var R=M.call(D,l.year,l.month,l.day),C=r(R,3),P=C[0],j=C[1],I=C[2],W=!1,H=j;H<I;H++)(W=v(p,D,L=P[H],b,w,k,g,E,m))&&(P[L]=null);if(u.notEmpty(_)&&u.notEmpty(x)){for(var F=void 0,q=void 0,K=[],B=0;B<_.length;B++){(N=_[B])<0?(F=Math.floor(N/x.length),q=u.pymod(N,x.length)):(F=Math.floor((N-1)/x.length),q=u.pymod(N-1,x.length));for(var G=[],V=j;V<I;V++){var X=P[V];u.isPresent(X)&&G.push(X)}var Q=void 0;Q=F<0?G.slice(F)[0]:G[F];var $=x[q],z=s.default.fromOrdinal(D.yearordinal+Q),J=s.default.combine(z,$);u.includes(K,J)||K.push(J)}s.default.sort(K);for(var Z=0;Z<K.length;Z++){var ee=K[Z];if(c&&ee>c)return this.emitResult(t);if(ee>=a){if(!t.accept(ee))return this.emitResult(t);if(U&&!--U)return this.emitResult(t)}}}else for(var te=j;te<I;te++)if(L=P[te],u.isPresent(L))for(var ne=s.default.fromOrdinal(D.yearordinal+L),re=0;re<x.length;re++){var ae=x[re],ie=s.default.combine(ne,ae);if(c&&ie>c)return this.emitResult(t);if(ie>=a){if(!t.accept(ie))return this.emitResult(t);if(U&&!--U)return this.emitResult(t)}}if(d===e.YEARLY?l.addYears(y):d===e.MONTHLY?l.addMonths(y):d===e.WEEKLY?l.addWeekly(y,f):d===e.DAILY?l.addDaily(y):d===e.HOURLY?(l.addHours(y,W,T),x=A.call(D,l.hour,l.minute,l.second)):d===e.MINUTELY?(l.addMinutes(y,W,T,O)&&(W=!1),x=A.call(D,l.hour,l.minute,l.second)):d===e.SECONDLY&&(l.addSeconds(y,W,T,O,Y)&&(W=!1),x=A.call(D,l.hour,l.minute,l.second)),l.year>s.default.MAXYEAR)return this.emitResult(t);D.rebuild(l.year,l.month)}}},{key:"emitResult",value:function(e){return this._len=e.total,e.getValue()}}],[{key:"parseText",value:function(e,t){return b().parseText(e,t)}},{key:"fromText",value:function(e,t){return b().fromText(e,t)}},{key:"fromString",value:function(t){return new e(e.parseString(t)||void 0)}}]),e}();function v(e,t,n,r,a,i,s,o,l){return u.notEmpty(e)&&!u.includes(e,t.mmask[n])||u.notEmpty(r)&&!t.wnomask[n]||u.notEmpty(a)&&!u.includes(a,t.wdaymask[n])||u.notEmpty(t.nwdaymask)&&!t.nwdaymask[n]||null!==i&&!u.includes(t.eastermask,n)||(u.notEmpty(s)||u.notEmpty(o))&&!u.includes(s,t.mdaymask[n])&&!u.includes(o,t.nmdaymask[n])||u.notEmpty(l)&&(n<t.yearlen&&!u.includes(l,n+1)&&!u.includes(l,-t.yearlen+n)||n>=t.yearlen&&!u.includes(l,n+1-t.yearlen)&&!u.includes(l,-t.nextyearlen+n-t.yearlen))}m.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],m.YEARLY=d.Frequency.YEARLY,m.MONTHLY=d.Frequency.MONTHLY,m.WEEKLY=d.Frequency.WEEKLY,m.DAILY=d.Frequency.DAILY,m.HOURLY=d.Frequency.HOURLY,m.MINUTELY=d.Frequency.MINUTELY,m.SECONDLY=d.Frequency.SECONDLY,m.MO=d.Days.MO,m.TU=d.Days.TU,m.WE=d.Days.WE,m.TH=d.Days.TH,m.FR=d.Days.FR,m.SA=d.Days.SA,m.SU=d.Days.SU,m.parseString=f.parseString,m.optionsToString=c.optionsToString,t.default=m},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=["MO","TU","WE","TH","FR","SA","SU"],i=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),0===n)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=n}return r(e,[{key:"nth",value:function(t){return this.n===t?this:new e(this.weekday,t)}},{key:"equals",value:function(e){return this.weekday===e.weekday&&this.n===e.n}},{key:"toString",value:function(){var e=a[this.weekday];return this.n&&(e=(this.n>0?"+":"")+String(this.n)+e),e}},{key:"getJsWeekday",value:function(){return 6===this.weekday?0:this.weekday+1}}]),e}();t.default=i},function(e,t,n){"use strict"; | ||
/*! | ||
@@ -16,2 +16,2 @@ * rrule.js - Library for working with recurrence rules for calendar dates. | ||
* | ||
*/Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.RRule=r.default;var a=n(8);t.RRuleSet=a.default;var i=n(17),o=n(5);t.Frequency=o.Frequency;var s=n(1);t.Weekday=s.default;var u=new i.default;t.rrulestr=function(){return u.parse.apply(u,arguments)},t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);!function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"}(t.Frequency||(t.Frequency={})),t.Days={MO:new r.default(0),TU:new r.default(1),WE:new r.default(2),TH:new r.default(3),FR:new r.default(4),SA:new r.default(5),SU:new r.default(6)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.method=t,this.args=n,this.minDate=null,this.maxDate=null,this._result=[],"between"===t?(this.maxDate=n.inc?n.before:new Date(n.before.getTime()-1),this.minDate=n.inc?n.after:new Date(n.after.getTime()+1)):"before"===t?this.maxDate=n.inc?n.dt:new Date(n.dt.getTime()-1):"after"===t&&(this.minDate=n.inc?n.dt:new Date(n.dt.getTime()+1))}return r(e,[{key:"accept",value:function(e){var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)}},{key:"add",value:function(e){return this._result.push(e),!0}},{key:"getValue",value:function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":return e.length?e[e.length-1]:null}}},{key:"clone",value:function(){return new e(this.method,this.args)}}]),e}();t.default=a},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),i=n(2),o=n(0),s=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{},e));return n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,[{key:"rrule",value:function(e){if(!(e instanceof a.default))throw new TypeError(String(e)+" is not RRule instance");o.includes(this._rrule.map(String),String(e))||this._rrule.push(e)}},{key:"rdate",value:function(e){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");o.includes(this._rdate.map(Number),Number(e))||(this._rdate.push(e),i.default.sort(this._rdate))}},{key:"exrule",value:function(e){if(!(e instanceof a.default))throw new TypeError(String(e)+" is not RRule instance");o.includes(this._exrule.map(String),String(e))||this._exrule.push(e)}},{key:"exdate",value:function(e){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");o.includes(this._exdate.map(Number),Number(e))||(this._exdate.push(e),i.default.sort(this._exdate))}},{key:"valueOf",value:function(){var e=[];return this._rrule.length&&this._rrule.forEach(function(t){e.push("RRULE:"+t)}),this._rdate.length&&e.push("RDATE:"+this._rdate.map(function(e){return i.default.timeToUntilString(e.valueOf())}).join(",")),this._exrule.length&&this._exrule.forEach(function(t){e.push("EXRULE:"+t)}),this._exdate.length&&e.push("EXDATE:"+this._exdate.map(function(e){return i.default.timeToUntilString(e.valueOf())}).join(",")),e}},{key:"toString",value:function(){return JSON.stringify(this.valueOf())}},{key:"_iter",value:function(e){var t={},n=this._exrule,r=e.accept;function a(e,r){n.forEach(function(n){n.between(e,r,!0).forEach(function(e){t[Number(e)]=!0})})}this._exdate.forEach(function(e){t[Number(e)]=!0}),e.accept=function(e){var n=Number(e);return!(!t[n]&&(a(new Date(n-1),new Date(n+1)),!t[n]))||(t[n]=!0,r.call(this,e))},"between"===e.method&&(a(e.args.after,e.args.before),e.accept=function(e){var n=Number(e);return!!t[n]||(t[n]=!0,r.call(this,e))});for(var o=0;o<this._rdate.length&&e.accept(new Date(this._rdate[o].valueOf()));o++);this._rrule.forEach(function(t){t._iter(e)});var s=e._result;switch(i.default.sort(s),e.method){case"all":case"between":return s;case"before":return s.length&&s[s.length-1]||null;case"after":return s.length&&s[0]||null;default:return null}}},{key:"clone",value:function(){var e=new t(!!this._cache),n=void 0;for(n=0;n<this._rrule.length;n++)e.rrule(this._rrule[n].clone());for(n=0;n<this._rdate.length;n++)e.rdate(new Date(this._rdate[n].valueOf()));for(n=0;n<this._exrule.length;n++)e.exrule(this._exrule[n].clone());for(n=0;n<this._exdate.length;n++)e.exdate(new Date(this._exdate[n].valueOf()));return e}}]),t}();t.default=s},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),i=n(3),o=n(2),s=n(0),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.yearlen=365,this.nextyearlen=365,this.rrule=t,this.mmask=null,this.mrange=null,this.mdaymask=null,this.nmdaymask=null,this.wdaymask=null,this.wnomask=null,this.nwdaymask=null,this.eastermask=null}return r(e,[{key:"easter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e%19,r=Math.floor(e/100),a=e%100,i=Math.floor(r/4),o=r%4,s=Math.floor((r+8)/25),u=Math.floor((r-s+1)/3),l=Math.floor(19*n+r-i-u+15)%30,d=Math.floor(a/4),h=a%4,y=Math.floor(32+2*o+2*d-l-h)%7,f=Math.floor((n+11*l+22*y)/451),c=Math.floor((l+y-7*f+114)/31),p=(l+y-7*f+114)%31+1,b=Date.UTC(e,c-1,p+t),m=Date.UTC(e,0,1);return[Math.ceil((b-m)/864e5)]}},{key:"rebuild",value:function(e,t){var n=this.rrule;if(e!==this.lastyear){this.yearlen=o.default.isLeapYear(e)?366:365,this.nextyearlen=o.default.isLeapYear(e+1)?366:365;var r=new Date(Date.UTC(e,0,1));this.yearordinal=o.default.toOrdinal(r),this.yearweekday=o.default.getWeekday(r);var u=o.default.getWeekday(r);if(365===this.yearlen?(this.mmask=s.clone(a.M365MASK),this.mdaymask=s.clone(a.MDAY365MASK),this.nmdaymask=s.clone(a.NMDAY365MASK),this.wdaymask=a.WDAYMASK.slice(u),this.mrange=s.clone(a.M365RANGE)):(this.mmask=s.clone(a.M366MASK),this.mdaymask=s.clone(a.MDAY366MASK),this.nmdaymask=s.clone(a.NMDAY366MASK),this.wdaymask=a.WDAYMASK.slice(u),this.mrange=s.clone(a.M366RANGE)),s.empty(n.options.byweekno))this.wnomask=null;else{this.wnomask=s.repeat(0,this.yearlen+7);var l,d=void 0,h=void 0;(d=l=s.pymod(7-this.yearweekday+n.options.wkst,7))>=4?(d=0,h=this.yearlen+s.pymod(this.yearweekday-n.options.wkst,7)):h=this.yearlen-d;for(var y=Math.floor(h/7),f=s.pymod(h,7),c=Math.floor(y+f/4),p=0;p<n.options.byweekno.length;p++){var b=void 0,m=n.options.byweekno[p];if(m<0&&(m+=c+1),m>0&&m<=c){m>1?(b=d+7*(m-1),d!==l&&(b-=7-l)):b=d;for(var v=0;v<7&&(this.wnomask[b]=1,b++,this.wdaymask[b]!==n.options.wkst);v++);}}if(s.includes(n.options.byweekno,1)){var w=d+7*c;if(d!==l&&(w-=7-l),w<this.yearlen)for(var k=0;k<7&&(this.wnomask[w]=1,w+=1,this.wdaymask[w]!==n.options.wkst);k++);}if(d){var g=void 0;if(s.includes(n.options.byweekno,-1))g=-1;else{var E=o.default.getWeekday(new Date(Date.UTC(e-1,0,1))),_=s.pymod(7-E.valueOf()+n.options.wkst,7),T=o.default.isLeapYear(e-1)?366:365;_>=4?(_=0,g=Math.floor(52+s.pymod(T+s.pymod(E-n.options.wkst,7),7)/4)):g=Math.floor(52+s.pymod(this.yearlen-d,7)/4)}if(s.includes(n.options.byweekno,g))for(var O=0;O<d;O++)this.wnomask[O]=1}}}if(s.notEmpty(n.options.bynweekday)&&(t!==this.lastmonth||e!==this.lastyear)){var Y=[];if(n.options.freq===i.default.YEARLY)if(s.notEmpty(n.options.bymonth))for(var D=0;D<n.options.bymonth.length;D++)t=n.options.bymonth[D],Y.push(this.mrange.slice(t-1,t+1));else Y=[[0,this.yearlen]];else n.options.freq===i.default.MONTHLY&&(Y=[this.mrange.slice(t-1,t+1)]);if(s.notEmpty(Y)){this.nwdaymask=s.repeat(0,this.yearlen);for(var S=0;S<Y.length;S++){var M=Y[S],A=M[0],x=M[1];x-=1;for(var L=0;L<n.options.bynweekday.length;L++){var U=void 0,N=n.options.bynweekday[L][0],R=n.options.bynweekday[L][1];R<0?(U=x+7*(R+1),U-=s.pymod(this.wdaymask[U]-N,7)):(U=A+7*(R-1),U+=s.pymod(7-this.wdaymask[U]+N,7)),A<=U&&U<=x&&(this.nwdaymask[U]=1)}}}this.lastyear=e,this.lastmonth=t}s.isPresent(n.options.byeaster)&&(this.eastermask=this.easter(e,n.options.byeaster))}},{key:"ydayset",value:function(){return[s.range(this.yearlen),0,this.yearlen]}},{key:"mdayset",value:function(e,t,n){for(var r=this.mrange[t-1],a=this.mrange[t],i=s.repeat(null,this.yearlen),o=r;o<a;o++)i[o]=o;return[i,r,a]}},{key:"wdayset",value:function(e,t,n){for(var r=s.repeat(null,this.yearlen+7),a=o.default.toOrdinal(new Date(Date.UTC(e,t-1,n)))-this.yearordinal,i=a,u=0;u<7&&(r[a]=a,++a,this.wdaymask[a]!==this.rrule.options.wkst);u++);return[r,i,a]}},{key:"ddayset",value:function(e,t,n){var r=s.repeat(null,this.yearlen),a=o.default.toOrdinal(new Date(Date.UTC(e,t-1,n)))-this.yearordinal;return r[a]=a,[r,a,a+1]}},{key:"htimeset",value:function(e,t,n,r){for(var a=[],i=this.rrule,s=0;s<i.options.byminute.length;s++){t=i.options.byminute[s];for(var u=0;u<i.options.bysecond.length;u++)n=i.options.bysecond[u],a.push(new o.default.Time(e,t,n,r))}return o.default.sort(a),a}},{key:"mtimeset",value:function(e,t,n,r){for(var a=[],i=this.rrule,s=0;s<i.options.bysecond.length;s++)n=i.options.bysecond[s],a.push(new o.default.Time(e,t,n,r));return o.default.sort(a),a}},{key:"stimeset",value:function(e,t,n,r){return[new o.default.Time(e,t,n,r)]}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=[].concat(r(a.repeat(1,31)),r(a.repeat(2,28)),r(a.repeat(3,31)),r(a.repeat(4,30)),r(a.repeat(5,31)),r(a.repeat(6,30)),r(a.repeat(7,31)),r(a.repeat(8,31)),r(a.repeat(9,30)),r(a.repeat(10,31)),r(a.repeat(11,30)),r(a.repeat(12,31)),r(a.repeat(1,7)));t.M365MASK=i;var o=[].concat(r(a.repeat(1,31)),r(a.repeat(2,29)),r(a.repeat(3,31)),r(a.repeat(4,30)),r(a.repeat(5,31)),r(a.repeat(6,30)),r(a.repeat(7,31)),r(a.repeat(8,31)),r(a.repeat(9,30)),r(a.repeat(10,31)),r(a.repeat(11,30)),r(a.repeat(12,31)),r(a.repeat(1,7)));t.M366MASK=o;var s=a.range(1,29),u=a.range(1,30),l=a.range(1,31),d=a.range(1,32),h=[].concat(r(d),r(u),r(d),r(l),r(d),r(l),r(d),r(d),r(l),r(d),r(l),r(d),r(d.slice(0,7)));t.MDAY366MASK=h;var y=[].concat(r(d),r(s),r(d),r(l),r(d),r(l),r(d),r(d),r(l),r(d),r(l),r(d),r(d.slice(0,7)));t.MDAY365MASK=y;var f=a.range(-28,0),c=a.range(-29,0),p=a.range(-30,0),b=a.range(-31,0),m=[].concat(r(b),r(c),r(b),r(p),r(b),r(p),r(b),r(b),r(p),r(b),r(p),r(b),r(b.slice(0,7)));t.NMDAY366MASK=m;var v=[].concat(r(b),r(f),r(b),r(p),r(b),r(p),r(b),r(b),r(p),r(b),r(p),r(b),r(b.slice(0,7)));t.NMDAY365MASK=v;t.M366RANGE=[0,31,60,91,121,152,182,213,244,274,305,335,366];t.M365RANGE=[0,31,59,90,120,151,181,212,243,273,304,334,365];var w=function(){for(var e=[],t=0;t<55;t++)e=e.concat(a.range(7));return e}();t.WDAYMASK=w},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),i=function(e){function t(e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return a.iterator=r,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,[{key:"add",value:function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)}}]),t}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n(3),i=n(2),o=n(1);function s(e){var t=[],n={};if(Object.keys(e).forEach(function(i){n[i]=e[i],r.includes(a.defaultKeys,i)||t.push(i)}),t.length)throw new Error("Invalid options: "+t.join(", "));return n}t.initializeOptions=s,t.parseOptions=function(e){var t=s(e),n=Object.keys(e);if(a.defaultKeys.forEach(function(e){r.includes(n,e)||(t[e]=a.DEFAULT_OPTIONS[e])}),r.isPresent(t.byeaster)&&(t.freq=a.default.YEARLY),!r.isPresent(t.freq)||!a.default.FREQUENCIES[t.freq])throw new Error("Invalid frequency: "+t.freq);t.dtstart||(t.dtstart=new Date((new Date).setMilliseconds(0)));var u=t.dtstart.getTime()%1e3;if(r.isPresent(t.wkst)?r.isNumber(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=a.default.MO.weekday,r.isPresent(t.bysetpos)){r.isNumber(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var l=0;l<t.bysetpos.length;l++){var d=t.bysetpos[l];if(0===d||!(d>=-366&&d<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(t.byweekno)||r.notEmpty(t.byweekno)||r.notEmpty(t.byyearday)||Boolean(t.bymonthday)||r.notEmpty(t.bymonthday)||null!==t.byweekday||null!==t.byeaster))switch(t.freq){case a.default.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case a.default.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case a.default.WEEKLY:t.byweekday=[i.default.getWeekday(t.dtstart)]}if(r.isPresent(t.bymonth)&&!r.isArray(t.bymonth)&&(t.bymonth=[t.bymonth]),r.isPresent(t.byyearday)&&!r.isArray(t.byyearday)&&r.isNumber(t.byyearday)&&(t.byyearday=[t.byyearday]),r.isPresent(t.bymonthday))if(r.isArray(t.bymonthday)){for(var h=[],y=[],f=0;f<t.bymonthday.length;f++){var c=t.bymonthday[f];c>0?h.push(c):c<0&&y.push(c)}t.bymonthday=h,t.bynmonthday=y}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(r.isPresent(t.byweekno)&&!r.isArray(t.byweekno)&&(t.byweekno=[t.byweekno]),r.isPresent(t.byweekday))if(r.isNumber(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(t.byweekday instanceof o.default)!t.byweekday.n||t.freq>a.default.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var p=[],b=[],m=0;m<t.byweekday.length;m++){var v=t.byweekday[m];if(r.isNumber(v))p.push(v);else{var w=v;!w.n||t.freq>a.default.MONTHLY?p.push(w.weekday):b.push([w.weekday,w.n])}}t.byweekday=r.notEmpty(p)?p:null,t.bynweekday=r.notEmpty(b)?b:null}else t.bynweekday=null;r.isPresent(t.byhour)?r.isNumber(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<a.default.HOURLY?[t.dtstart.getUTCHours()]:null,r.isPresent(t.byminute)?r.isNumber(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<a.default.MINUTELY?[t.dtstart.getUTCMinutes()]:null,r.isPresent(t.bysecond)?r.isNumber(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<a.default.SECONDLY?[t.dtstart.getUTCSeconds()]:null;var k=void 0;if(t.freq>=a.default.HOURLY)k=null;else{k=[];for(var g=0;g<t.byhour.length;g++)for(var E=t.byhour[g],_=0;_<t.byminute.length;_++)for(var T=t.byminute[_],O=0;O<t.bysecond.length;O++){var Y=t.bysecond[O];k.push(new i.default.Time(E,T,Y,u))}i.default.sort(k)}return{parsedOptions:t,timeset:k}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),a=n(1),i=n(2);t.parseString=function(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;for(var t=e.split(";"),n={},o=0;o<t.length;o++){var s=t[o].split("="),u=s[0],l=s[1];switch(u){case"FREQ":n.freq=r.Frequency[l];break;case"WKST":n.wkst=r.Days[l];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var d=void 0;d=-1!==l.indexOf(",")?l.split(",").map(function(e){return/^[+-]?\d+$/.test(e.toString())?Number(e):e}):/^[+-]?\d+$/.test(l)?Number(l):l,n[u.toLowerCase()]=d;break;case"BYDAY":var h=void 0,y=void 0,f=void 0,c=l.split(",");n.byweekday=[];for(var p=0;p<c.length;p++)if(2===(f=c[p]).length)y=r.Days[f],n.byweekday.push(y);else{var b=f.match(/^([+-]?\d)([A-Z]{2})$/);h=Number(b[1]);var m=b[2];y=r.Days[m].weekday,n.byweekday.push(new a.default(y,h))}break;case"DTSTART":n.dtstart=i.default.untilStringToDate(l);break;case"UNTIL":n.until=i.default.untilStringToDate(l);break;case"BYEASTER":n.byeaster=Number(l);break;default:throw new Error("Unknown RRULE property '"+u+"'")}}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),a=n(16);t.parseText=a.default;var i=n(4),o=n(6);t.fromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.default;return new i.default(a.default(e,t)||void 0)};var s=["count","until","interval","byweekday","bymonthday","bymonth"];r.default.IMPLEMENTED=[],r.default.IMPLEMENTED[i.default.HOURLY]=s,r.default.IMPLEMENTED[i.default.MINUTELY]=s,r.default.IMPLEMENTED[i.default.DAILY]=["byhour"].concat(s),r.default.IMPLEMENTED[i.default.WEEKLY]=s,r.default.IMPLEMENTED[i.default.MONTHLY]=s,r.default.IMPLEMENTED[i.default.YEARLY]=["byweekno","byyearday"].concat(s);t.toText=function(e,t,n){return new r.default(e,t,n).toString()};var u=r.default.isFullyConvertible;t.isFullyConvertible=u},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),i=n(4),o=n(0),s=function(e,t){return-1!==e.indexOf(t)},u=function(e){return e.toString()},l=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.default;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=[],this.language=r||a.default,this.gettext=n,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),s=[].concat(this.options.bynmonthday);i.sort(),s.sort(),s.reverse(),this.bymonthday=i.concat(s),this.bymonthday.length||(this.bymonthday=null)}if(this.origOptions.byweekday){var l=o.isArray(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],d=String(l);this.byweekday={allWeeks:l.filter(function(e){return!e.n}),someWeeks:l.filter(function(e){return Boolean(e.n)}),isWeekdays:-1!==d.indexOf("MO")&&-1!==d.indexOf("TU")&&-1!==d.indexOf("WE")&&-1!==d.indexOf("TH")&&-1!==d.indexOf("FR")&&-1===d.indexOf("SA")&&-1===d.indexOf("SU")};var h=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(h),this.byweekday.someWeeks.sort(h),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r(e,[{key:"isFullyConvertible",value:function(){return e.isFullyConvertible(this.rrule)}},{key:"toString",value:function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[i.default.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.language.monthNames[n.getUTCMonth()]).add(n.getUTCDate()+",").add(n.getUTCFullYear().toString())}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")}},{key:"HOURLY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))}},{key:"MINUTELY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add((this.plural(this.options.interval),e("minutes")))}},{key:"DAILY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()}},{key:"WEEKLY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):(1===this.options.interval&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())}},{key:"MONTHLY",value:function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()}},{key:"YEARLY",value:function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))}},{key:"_bymonthday",value:function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))}},{key:"_byweekday",value:function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))}},{key:"_byhour",value:function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))}},{key:"_bymonth",value:function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))}},{key:"nth",value:function(e){e=parseInt(e.toString(),10);var t,n=void 0,r=this.gettext;if(-1===e)return r("last");switch(t=Math.abs(e)){case 1:case 21:case 31:n=t+r("st");break;case 2:case 22:n=t+r("nd");break;case 3:case 23:n=t+r("rd");break;default:n=t+r("th")}return e<0?n+" "+r("last"):n}},{key:"monthtext",value:function(e){return this.language.monthNames[e-1]}},{key:"weekdaytext",value:function(e){var t=o.isNumber(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]}},{key:"plural",value:function(e){return e%100!=1}},{key:"add",value:function(e){return this.text.push(" "),this.text.push(e),this}},{key:"list",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";o.isArray(e)||(e=[e]);t=t||function(e){return e.toString()};var a=this,i=function(e){return t&&t.call(a,e)};return n?function(e,t,n){for(var r="",a=0;a<e.length;a++)0!==a&&(a===e.length-1?r+=" "+n+" ":r+=t+" "),r+=e[a];return r}(e.map(i),r,n):e.map(i).join(r+" ")}}],[{key:"isFullyConvertible",value:function(t){if(!(t.options.freq in e.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var n in t.origOptions){if(s(["dtstart","wkst","freq"],n))return!0;if(!s(e.IMPLEMENTED[t.options.freq],n))return!1}return!0}}]),e}();t.default=l},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(6),i=n(4),o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.done=!0,this.rules=t}return r(e,[{key:"start",value:function(e){return this.text=e,this.done=!1,this.nextSymbol()}},{key:"isDone",value:function(){return this.done&&null===this.symbol}},{key:"nextSymbol",value:function(){var e=void 0,t=void 0;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in e=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===e||r[0].length>e[0].length)&&(e=r,t=n)}if(null!=e&&(this.text=this.text.substr(e[0].length),""===this.text&&(this.done=!0)),null==e)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===t);return this.symbol=t,this.value=e,!0}},{key:"accept",value:function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1}},{key:"acceptNumber",value:function(){return this.accept("number")}},{key:"expect",value:function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)}}]),e}();t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default,n={},r=new o(t.tokens);return r.start(e)?(function(){r.expect("every");var e=r.acceptNumber();if(e&&(n.interval=parseInt(e[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=i.default.DAILY,r.nextSymbol()&&(function(){if(r.accept("at"))do{var e=r.acceptNumber();if(!e)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(e[0],10)];r.accept("comma");){if(!(e=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(e[0],10))}}while(r.accept("comma")||r.accept("at"))}(),h());break;case"weekday(s)":n.freq=i.default.WEEKLY,n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR],r.nextSymbol(),h();break;case"week(s)":n.freq=i.default.WEEKLY,r.nextSymbol()&&(s(),h());break;case"hour(s)":n.freq=i.default.HOURLY,r.nextSymbol()&&(s(),h());break;case"minute(s)":n.freq=i.default.MINUTELY,r.nextSymbol()&&(s(),h());break;case"month(s)":n.freq=i.default.MONTHLY,r.nextSymbol()&&(s(),h());break;case"year(s)":n.freq=i.default.YEARLY,r.nextSymbol()&&(s(),h());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=i.default.WEEKLY;var t=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[i.default[t]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var a=l();if(!a)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(i.default[a]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var e=d();if(e)for(n.bymonthday=[e],r.nextSymbol();r.accept("comma");){if(!(e=d()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(e),r.nextSymbol()}}(),h();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=i.default.YEARLY,n.bymonth=[u()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var o=u();if(!o)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(o),r.nextSymbol()}s(),h();break;default:throw new Error("Unknown symbol")}}(),n):null;function s(){var e=r.accept("on"),t=r.accept("the");if(e||t)do{var a=d(),o=l(),s=u();if(a)o?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[o].nth(a))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(a),r.accept("day(s)"));else if(o)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[o]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var h=r.acceptNumber();if(!h)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(h[0],10)];r.accept("comma");){if(!(h=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(h[0],10))}}else{if(!s)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(s)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function u(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function l(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function d(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var e=parseInt(r.value[1],10);if(e<-366||e>366)throw new Error("Nth out of range: "+e);return r.nextSymbol(),r.accept("last")?-e:e;default:return!1}}function h(){if("until"===r.symbol){var e=Date.parse(r.text);if(!e)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(e)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),i=n(8),o=n(2),s=n(1),u=n(0),l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._handle_BYDAY=this._handle_BYWEEKDAY,this._handle_INTERVAL=this._handle_int,this._handle_COUNT=this._handle_int,this._handle_BYSETPOS=this._handle_int_list,this._handle_BYMONTH=this._handle_int_list,this._handle_BYMONTHDAY=this._handle_int_list,this._handle_BYYEARDAY=this._handle_int_list,this._handle_BYEASTER=this._handle_int_list,this._handle_BYWEEKNO=this._handle_int_list,this._handle_BYHOUR=this._handle_int_list,this._handle_BYMINUTE=this._handle_int_list,this._handle_BYSECOND=this._handle_int_list}return r(e,[{key:"_handle_DTSTART",value:function(e,t,n,r){e.dtstart=o.default.untilStringToDate(n)}},{key:"_handle_int",value:function(e,t,n){e[t.toLowerCase()]=parseInt(n,10)}},{key:"_handle_int_list",value:function(e,t,n){e[t.toLowerCase()]=n.split(",").map(function(e){return parseInt(e,10)})}},{key:"_handle_FREQ",value:function(t,n,r,a){t.freq=e._freq_map[r]}},{key:"_handle_UNTIL",value:function(e,t,n,r){try{e.until=o.default.untilStringToDate(n)}catch(e){throw new Error("invalid until date")}}},{key:"_handle_WKST",value:function(t,n,r,a){t.wkst=e._weekday_map[r]}},{key:"_handle_BYWEEKDAY",value:function(t,n,r,a){var i=void 0,o=void 0,u=void 0,l=void 0,d=void 0,h=void 0,y=[],f=r.split(",");for(o=0;o<f.length;o++){if((h=f[o]).indexOf("(")>-1)d=(i=h.split("("))[0],l=parseInt(i.slice(1,-1)[0],10);else{for(u=0;u<h.length&&-1!=="+-0123456789".indexOf(h[u]);u++);l=h.slice(0,u)||null,d=h.slice(u),l&&(l=parseInt(l,10))}var c=new s.default(e._weekday_map[d],l);y.push(c)}t.byweekday=y}},{key:"_parseRfcRRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.dtstart=t.dtstart||null,t.cache=t.cache||!1;var n=void 0,r=void 0,i=void 0;if(-1!==e.indexOf(":")){if(n=(i=e.split(":"))[0],r=i[1],"RRULE"!==n)throw new Error("unknown parameter name")}else r=e;for(var o={},s=r.split(";"),u=0;u<s.length;u++){n=(i=s[u].split("="))[0].toUpperCase(),r=i[1].toUpperCase();try{this["_handle_"+n](o,n,r)}catch(e){throw new Error("unknown parameter '"+n+"':"+r)}}return o.dtstart=o.dtstart||t.dtstart,new a.default(o,!t.cache)}},{key:"_parseRfc",value:function(e,t){if(t.compatible&&(t.forceset=!0,t.unfold=!0),!(e=e&&e.toUpperCase().trim()))throw new Error("Invalid empty string");var n=0,r=void 0,a=void 0;if(t.unfold)for(a=e.split("\n");n<a.length;)(r=a[n]=a[n].replace(/\s+$/g,""))?n>0&&" "===r[0]?(a[n-1]+=r.slice(1),a.splice(n,1)):n+=1:a.splice(n,1);else a=e.split(/\s/);var s=[],l=[],d=[],h=[],y=void 0,f=void 0,c=void 0,p=void 0,b=void 0,m=void 0,v=void 0,w=void 0,k=void 0;if(t.forceset||1!==a.length||-1!==e.indexOf(":")&&0!==e.indexOf("RRULE:")){for(var g=0;g<a.length;g++)if(r=a[g]){-1===r.indexOf(":")?(y="RRULE",f=r):(y=(c=u.split(r,":",1))[0],f=c[1]);var E=y.split(";");if(!E)throw new Error("empty property name");if(y=E[0],E=E.slice(1),"RRULE"===y){for(m=0;m<E.length;m++){var _=E[m];throw new Error("unsupported RRULE parm: "+_)}s.push(f)}else if("RDATE"===y){for(m=0;m<E.length;m++){var T=E[m];if("VALUE=DATE-TIME"!==T&&"VALUE=DATE"!==T)throw new Error("unsupported RDATE parm: "+T)}l.push(f)}else if("EXRULE"===y){for(m=0;m<E.length;m++){var O=E[m];throw new Error("unsupported EXRULE parm: "+O)}d.push(f)}else if("EXDATE"===y){for(m=0;m<E.length;m++){var Y=E[m];if("VALUE=DATE-TIME"!==Y&&"VALUE=DATE"!==Y)throw new Error("unsupported EXDATE parm: "+Y)}h.push(f)}else{if("DTSTART"!==y)throw new Error("unsupported property: "+y);p=o.default.untilStringToDate(f)}}if(t.forceset||s.length>1||l.length||d.length||h.length){for(b=new i.default(!t.cache),m=0;m<s.length;m++)b.rrule(this._parseRfcRRule(s[m],{dtstart:t.dtstart||p}));for(m=0;m<l.length;m++)for(w=l[m].split(","),v=0;v<w.length;v++)k=w[v],b.rdate(o.default.untilStringToDate(k));for(m=0;m<d.length;m++)b.exrule(this._parseRfcRRule(d[m],{dtstart:t.dtstart||p}));for(m=0;m<h.length;m++)for(w=h[m].split(","),v=0;v<w.length;v++)k=w[v],b.exdate(o.default.untilStringToDate(k));return t.compatible&&t.dtstart&&b.rdate(p),b}return this._parseRfcRRule(s[0],{dtstart:t.dtstart||p,cache:t.cache})}return this._parseRfcRRule(a[0],{cache:t.cache,dtstart:t.dtstart})}},{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],a=Object.keys(n),i=Object.keys(e.DEFAULT_OPTIONS);if(a.forEach(function(e){u.includes(i,e)||r.push(e)},this),r.length)throw new Error("Invalid options: "+r.join(", "));return i.forEach(function(t){u.includes(a,t)||(n[t]=e.DEFAULT_OPTIONS[t])}),this._parseRfc(t,n)}}]),e}();l._weekday_map={MO:0,TU:1,WE:2,TH:3,FR:4,SA:5,SU:6},l._freq_map={YEARLY:a.default.YEARLY,MONTHLY:a.default.MONTHLY,WEEKLY:a.default.WEEKLY,DAILY:a.default.DAILY,HOURLY:a.default.HOURLY,MINUTELY:a.default.MINUTELY,SECONDLY:a.default.SECONDLY},l.DEFAULT_OPTIONS={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1},t.default=l}])}); | ||
*/Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.RRule=r.default;var a=n(8);t.RRuleSet=a.default;var i=n(19),s=n(6);t.Frequency=s.Frequency;var o=n(3);t.Weekday=o.default;var u=new i.default;t.rrulestr=function(){return u.parse.apply(u,arguments)},t.default=r.default},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minDate=null,this.maxDate=null,this._result=[],this.total=0,this.method=t,this.args=n,"between"===t?(this.maxDate=n.inc?n.before:new Date(n.before.getTime()-1),this.minDate=n.inc?n.after:new Date(n.after.getTime()+1)):"before"===t?this.maxDate=n.inc?n.dt:new Date(n.dt.getTime()-1):"after"===t&&(this.minDate=n.inc?n.dt:new Date(n.dt.getTime()+1))}return r(e,[{key:"accept",value:function(e){++this.total;var t=this.minDate&&e<this.minDate,n=this.maxDate&&e>this.maxDate;if("between"===this.method){if(t)return!0;if(n)return!1}else if("before"===this.method){if(n)return!1}else if("after"===this.method)return!!t||(this.add(e),!1);return this.add(e)}},{key:"add",value:function(e){return this._result.push(e),!0}},{key:"getValue",value:function(){var e=this._result;switch(this.method){case"all":case"between":return e;case"before":case"after":return e.length?e[e.length-1]:null}}},{key:"clone",value:function(){return new e(this.method,this.args)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);!function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"}(t.Frequency||(t.Frequency={})),t.Days={MO:new r.default(0),TU:new r.default(1),WE:new r.default(2),TH:new r.default(3),FR:new r.default(4),SA:new r.default(5),SU:new r.default(6)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],tokens:{SKIP:/^[ \r\n\t]+|^\.$/,number:/^[1-9][0-9]*/,numberAsText:/^(one|two|three)/i,every:/^every/i,"day(s)":/^days?/i,"weekday(s)":/^weekdays?/i,"week(s)":/^weeks?/i,"hour(s)":/^hours?/i,"minute(s)":/^minutes?/i,"month(s)":/^months?/i,"year(s)":/^years?/i,on:/^(on|in)/i,at:/^(at)/i,the:/^the/i,first:/^first/i,second:/^second/i,third:/^third/i,nth:/^([1-9][0-9]*)(\.|th|nd|rd|st)/i,last:/^last/i,for:/^for/i,"time(s)":/^times?/i,until:/^(un)?til/i,monday:/^mo(n(day)?)?/i,tuesday:/^tu(e(s(day)?)?)?/i,wednesday:/^we(d(n(esday)?)?)?/i,thursday:/^th(u(r(sday)?)?)?/i,friday:/^fr(i(day)?)?/i,saturday:/^sa(t(urday)?)?/i,sunday:/^su(n(day)?)?/i,january:/^jan(uary)?/i,february:/^feb(ruary)?/i,march:/^mar(ch)?/i,april:/^apr(il)?/i,may:/^may/i,june:/^june?/i,july:/^july?/i,august:/^aug(ust)?/i,september:/^sep(t(ember)?)?/i,october:/^oct(ober)?/i,november:/^nov(ember)?/i,december:/^dec(ember)?/i,comma:/^(,\s*|(and|or)\s*)+/i}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),i=n(1),s=n(0),o=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{},e));return n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,[{key:"rrule",value:function(e){if(!(e instanceof a.default))throw new TypeError(String(e)+" is not RRule instance");s.includes(this._rrule.map(String),String(e))||this._rrule.push(e)}},{key:"rdate",value:function(e){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");s.includes(this._rdate.map(Number),Number(e))||(this._rdate.push(e),i.default.sort(this._rdate))}},{key:"exrule",value:function(e){if(!(e instanceof a.default))throw new TypeError(String(e)+" is not RRule instance");s.includes(this._exrule.map(String),String(e))||this._exrule.push(e)}},{key:"exdate",value:function(e){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");s.includes(this._exdate.map(Number),Number(e))||(this._exdate.push(e),i.default.sort(this._exdate))}},{key:"valueOf",value:function(){var e=[];return this._rrule.length&&this._rrule.forEach(function(t){e.push("RRULE:"+t)}),this._rdate.length&&e.push("RDATE:"+this._rdate.map(function(e){return i.default.timeToUntilString(e.valueOf())}).join(",")),this._exrule.length&&this._exrule.forEach(function(t){e.push("EXRULE:"+t)}),this._exdate.length&&e.push("EXDATE:"+this._exdate.map(function(e){return i.default.timeToUntilString(e.valueOf())}).join(",")),e}},{key:"toString",value:function(){return JSON.stringify(this.valueOf())}},{key:"_iter",value:function(e){var t={},n=this._exrule,r=e.accept;function a(e,r){n.forEach(function(n){n.between(e,r,!0).forEach(function(e){t[Number(e)]=!0})})}this._exdate.forEach(function(e){t[Number(e)]=!0}),e.accept=function(e){var n=Number(e);return!(!t[n]&&(a(new Date(n-1),new Date(n+1)),!t[n]))||(t[n]=!0,r.call(this,e))},"between"===e.method&&(a(e.args.after,e.args.before),e.accept=function(e){var n=Number(e);return!!t[n]||(t[n]=!0,r.call(this,e))});for(var s=0;s<this._rdate.length&&e.accept(new Date(this._rdate[s].valueOf()));s++);this._rrule.forEach(function(t){t._iter(e)});var o=e._result;switch(i.default.sort(o),e.method){case"all":case"between":return o;case"before":return o.length&&o[o.length-1]||null;case"after":return o.length&&o[0]||null;default:return null}}},{key:"clone",value:function(){var e=new t(!!this._cache),n=void 0;for(n=0;n<this._rrule.length;n++)e.rrule(this._rrule[n].clone());for(n=0;n<this._rdate.length;n++)e.rdate(new Date(this._rdate[n].valueOf()));for(n=0;n<this._exrule.length;n++)e.exrule(this._exrule[n].clone());for(n=0;n<this._exdate.length;n++)e.exdate(new Date(this._exdate[n].valueOf()));return e}}]),t}();t.default=o},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(10),i=n(2),s=n(1),o=n(0),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.yearlen=365,this.nextyearlen=365,this.rrule=t,this.mmask=null,this.mrange=null,this.mdaymask=null,this.nmdaymask=null,this.wdaymask=null,this.wnomask=null,this.nwdaymask=null,this.eastermask=null}return r(e,[{key:"easter",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e%19,r=Math.floor(e/100),a=e%100,i=Math.floor(r/4),s=r%4,o=Math.floor((r+8)/25),u=Math.floor((r-o+1)/3),l=Math.floor(19*n+r-i-u+15)%30,h=Math.floor(a/4),d=a%4,y=Math.floor(32+2*s+2*h-l-d)%7,f=Math.floor((n+11*l+22*y)/451),c=Math.floor((l+y-7*f+114)/31),p=(l+y-7*f+114)%31+1,b=Date.UTC(e,c-1,p+t),m=Date.UTC(e,0,1);return[Math.ceil((b-m)/864e5)]}},{key:"rebuild",value:function(e,t){var n=this.rrule;e!==this.lastyear&&this.rebuildYear(e),!o.notEmpty(n.options.bynweekday)||t===this.lastmonth&&e===this.lastyear||this.rebuildMonth(e,t),o.isPresent(n.options.byeaster)&&(this.eastermask=this.easter(e,n.options.byeaster))}},{key:"rebuildYear",value:function(e){var t=this.rrule;this.yearlen=s.default.isLeapYear(e)?366:365,this.nextyearlen=s.default.isLeapYear(e+1)?366:365;var n=new Date(Date.UTC(e,0,1));this.yearordinal=s.default.toOrdinal(n),this.yearweekday=s.default.getWeekday(n);var r=s.default.getWeekday(n);if(365===this.yearlen?(this.mmask=a.M365MASK,this.mdaymask=a.MDAY365MASK,this.nmdaymask=a.NMDAY365MASK,this.wdaymask=a.WDAYMASK.slice(r),this.mrange=a.M365RANGE):(this.mmask=a.M366MASK,this.mdaymask=a.MDAY366MASK,this.nmdaymask=a.NMDAY366MASK,this.wdaymask=a.WDAYMASK.slice(r),this.mrange=a.M366RANGE),o.empty(t.options.byweekno))this.wnomask=null;else{this.wnomask=o.repeat(0,this.yearlen+7);var i,u=void 0,l=void 0;(u=i=o.pymod(7-this.yearweekday+t.options.wkst,7))>=4?(u=0,l=this.yearlen+o.pymod(this.yearweekday-t.options.wkst,7)):l=this.yearlen-u;for(var h=Math.floor(l/7),d=o.pymod(l,7),y=Math.floor(h+d/4),f=0;f<t.options.byweekno.length;f++){var c=void 0,p=t.options.byweekno[f];if(p<0&&(p+=y+1),p>0&&p<=y){p>1?(c=u+7*(p-1),u!==i&&(c-=7-i)):c=u;for(var b=0;b<7&&(this.wnomask[c]=1,c++,this.wdaymask[c]!==t.options.wkst);b++);}}if(o.includes(t.options.byweekno,1)){var m=u+7*y;if(u!==i&&(m-=7-i),m<this.yearlen)for(var v=0;v<7&&(this.wnomask[m]=1,m+=1,this.wdaymask[m]!==t.options.wkst);v++);}if(u){var w=void 0;if(o.includes(t.options.byweekno,-1))w=-1;else{var k=s.default.getWeekday(new Date(Date.UTC(e-1,0,1))),g=o.pymod(7-k.valueOf()+t.options.wkst,7),E=s.default.isLeapYear(e-1)?366:365;g>=4?(g=0,w=Math.floor(52+o.pymod(E+o.pymod(k-t.options.wkst,7),7)/4)):w=Math.floor(52+o.pymod(this.yearlen-u,7)/4)}if(o.includes(t.options.byweekno,w))for(var _=0;_<u;_++)this.wnomask[_]=1}}}},{key:"rebuildMonth",value:function(e,t){var n=this.rrule,r=[];if(n.options.freq===i.default.YEARLY)if(o.notEmpty(n.options.bymonth))for(var a=0;a<n.options.bymonth.length;a++)t=n.options.bymonth[a],r.push(this.mrange.slice(t-1,t+1));else r=[[0,this.yearlen]];else n.options.freq===i.default.MONTHLY&&(r=[this.mrange.slice(t-1,t+1)]);if(o.notEmpty(r)){this.nwdaymask=o.repeat(0,this.yearlen);for(var s=0;s<r.length;s++){var u=r[s],l=u[0],h=u[1];h-=1;for(var d=0;d<n.options.bynweekday.length;d++){var y=void 0,f=n.options.bynweekday[d][0],c=n.options.bynweekday[d][1];c<0?(y=h+7*(c+1),y-=o.pymod(this.wdaymask[y]-f,7)):(y=l+7*(c-1),y+=o.pymod(7-this.wdaymask[y]+f,7)),l<=y&&y<=h&&(this.nwdaymask[y]=1)}}}this.lastyear=e,this.lastmonth=t}},{key:"ydayset",value:function(){return[o.range(this.yearlen),0,this.yearlen]}},{key:"mdayset",value:function(e,t,n){for(var r=this.mrange[t-1],a=this.mrange[t],i=o.repeat(null,this.yearlen),s=r;s<a;s++)i[s]=s;return[i,r,a]}},{key:"wdayset",value:function(e,t,n){for(var r=o.repeat(null,this.yearlen+7),a=s.default.toOrdinal(new Date(Date.UTC(e,t-1,n)))-this.yearordinal,i=a,u=0;u<7&&(r[a]=a,++a,this.wdaymask[a]!==this.rrule.options.wkst);u++);return[r,i,a]}},{key:"ddayset",value:function(e,t,n){var r=o.repeat(null,this.yearlen),a=s.default.toOrdinal(new Date(Date.UTC(e,t-1,n)))-this.yearordinal;return r[a]=a,[r,a,a+1]}},{key:"htimeset",value:function(e,t,n,r){for(var a=[],i=this.rrule,o=0;o<i.options.byminute.length;o++){t=i.options.byminute[o];for(var u=0;u<i.options.bysecond.length;u++)n=i.options.bysecond[u],a.push(new s.default.Time(e,t,n,r))}return s.default.sort(a),a}},{key:"mtimeset",value:function(e,t,n,r){for(var a=[],i=this.rrule,o=0;o<i.options.bysecond.length;o++)n=i.options.bysecond[o],a.push(new s.default.Time(e,t,n,r));return s.default.sort(a),a}},{key:"stimeset",value:function(e,t,n,r){return[new s.default.Time(e,t,n,r)]}}]),e}();t.default=u},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=[].concat(r(a.repeat(1,31)),r(a.repeat(2,28)),r(a.repeat(3,31)),r(a.repeat(4,30)),r(a.repeat(5,31)),r(a.repeat(6,30)),r(a.repeat(7,31)),r(a.repeat(8,31)),r(a.repeat(9,30)),r(a.repeat(10,31)),r(a.repeat(11,30)),r(a.repeat(12,31)),r(a.repeat(1,7)));t.M365MASK=i;var s=[].concat(r(a.repeat(1,31)),r(a.repeat(2,29)),r(a.repeat(3,31)),r(a.repeat(4,30)),r(a.repeat(5,31)),r(a.repeat(6,30)),r(a.repeat(7,31)),r(a.repeat(8,31)),r(a.repeat(9,30)),r(a.repeat(10,31)),r(a.repeat(11,30)),r(a.repeat(12,31)),r(a.repeat(1,7)));t.M366MASK=s;var o=a.range(1,29),u=a.range(1,30),l=a.range(1,31),h=a.range(1,32),d=[].concat(r(h),r(u),r(h),r(l),r(h),r(l),r(h),r(h),r(l),r(h),r(l),r(h),r(h.slice(0,7)));t.MDAY366MASK=d;var y=[].concat(r(h),r(o),r(h),r(l),r(h),r(l),r(h),r(h),r(l),r(h),r(l),r(h),r(h.slice(0,7)));t.MDAY365MASK=y;var f=a.range(-28,0),c=a.range(-29,0),p=a.range(-30,0),b=a.range(-31,0),m=[].concat(r(b),r(c),r(b),r(p),r(b),r(p),r(b),r(b),r(p),r(b),r(p),r(b),r(b.slice(0,7)));t.NMDAY366MASK=m;var v=[].concat(r(b),r(f),r(b),r(p),r(b),r(p),r(b),r(b),r(p),r(b),r(p),r(b),r(b.slice(0,7)));t.NMDAY365MASK=v;t.M366RANGE=[0,31,60,91,121,152,182,213,244,274,305,335,366];t.M365RANGE=[0,31,59,90,120,151,181,212,243,273,304,334,365];var w=function(){for(var e=[],t=0;t<55;t++)e=e.concat(a.range(7));return e}();t.WDAYMASK=w},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(5),i=function(e){function t(e,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return a.iterator=r,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.default),r(t,[{key:"add",value:function(e){return!!this.iterator(e,this._result.length)&&(this._result.push(e),!0)}}]),t}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n(2),i=n(1),s=n(3);function o(e){var t=[],n={};if(Object.keys(e).forEach(function(i){n[i]=e[i],r.includes(a.defaultKeys,i)||t.push(i)}),t.length)throw new Error("Invalid options: "+t.join(", "));return n}t.initializeOptions=o,t.parseOptions=function(e){var t=o(e),n=Object.keys(e);if(a.defaultKeys.forEach(function(e){r.includes(n,e)||(t[e]=a.DEFAULT_OPTIONS[e])}),r.isPresent(t.byeaster)&&(t.freq=a.default.YEARLY),!r.isPresent(t.freq)||!a.default.FREQUENCIES[t.freq])throw new Error("Invalid frequency: "+t.freq);t.dtstart||(t.dtstart=new Date((new Date).setMilliseconds(0)));var u=t.dtstart.getTime()%1e3;if(r.isPresent(t.wkst)?r.isNumber(t.wkst)||(t.wkst=t.wkst.weekday):t.wkst=a.default.MO.weekday,r.isPresent(t.bysetpos)){r.isNumber(t.bysetpos)&&(t.bysetpos=[t.bysetpos]);for(var l=0;l<t.bysetpos.length;l++){var h=t.bysetpos[l];if(0===h||!(h>=-366&&h<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(Boolean(t.byweekno)||r.notEmpty(t.byweekno)||r.notEmpty(t.byyearday)||Boolean(t.bymonthday)||r.notEmpty(t.bymonthday)||r.isPresent(t.byweekday)||r.isPresent(t.byeaster)))switch(t.freq){case a.default.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case a.default.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case a.default.WEEKLY:t.byweekday=[i.default.getWeekday(t.dtstart)]}if(r.isPresent(t.bymonth)&&!r.isArray(t.bymonth)&&(t.bymonth=[t.bymonth]),r.isPresent(t.byyearday)&&!r.isArray(t.byyearday)&&r.isNumber(t.byyearday)&&(t.byyearday=[t.byyearday]),r.isPresent(t.bymonthday))if(r.isArray(t.bymonthday)){for(var d=[],y=[],f=0;f<t.bymonthday.length;f++){var c=t.bymonthday[f];c>0?d.push(c):c<0&&y.push(c)}t.bymonthday=d,t.bynmonthday=y}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);else t.bymonthday=[],t.bynmonthday=[];if(r.isPresent(t.byweekno)&&!r.isArray(t.byweekno)&&(t.byweekno=[t.byweekno]),r.isPresent(t.byweekday))if(r.isNumber(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(t.byweekday instanceof s.default)!t.byweekday.n||t.freq>a.default.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var p=[],b=[],m=0;m<t.byweekday.length;m++){var v=t.byweekday[m];if(r.isNumber(v))p.push(v);else{var w=v;!w.n||t.freq>a.default.MONTHLY?p.push(w.weekday):b.push([w.weekday,w.n])}}t.byweekday=r.notEmpty(p)?p:null,t.bynweekday=r.notEmpty(b)?b:null}else t.bynweekday=null;r.isPresent(t.byhour)?r.isNumber(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq<a.default.HOURLY?[t.dtstart.getUTCHours()]:null,r.isPresent(t.byminute)?r.isNumber(t.byminute)&&(t.byminute=[t.byminute]):t.byminute=t.freq<a.default.MINUTELY?[t.dtstart.getUTCMinutes()]:null,r.isPresent(t.bysecond)?r.isNumber(t.bysecond)&&(t.bysecond=[t.bysecond]):t.bysecond=t.freq<a.default.SECONDLY?[t.dtstart.getUTCSeconds()]:null;var k=void 0;if(t.freq>=a.default.HOURLY)k=null;else{k=[];for(var g=0;g<t.byhour.length;g++)for(var E=t.byhour[g],_=0;_<t.byminute.length;_++)for(var T=t.byminute[_],O=0;O<t.bysecond.length;O++){var Y=t.bysecond[O];k.push(new i.default.Time(E,T,Y,u))}i.default.sort(k)}return{parsedOptions:t,timeset:k}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),a=n(3),i=n(1);t.parseString=function(e){if(!(e=e.replace(/^\s+|\s+$/,"")).length)return null;for(var t=e.split(";"),n={},s=0;s<t.length;s++){var o=t[s].split("="),u=o[0],l=o[1];switch(u){case"FREQ":n.freq=r.Frequency[l];break;case"WKST":n.wkst=r.Days[l];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var h=void 0;h=-1!==l.indexOf(",")?l.split(",").map(function(e){return/^[+-]?\d+$/.test(e.toString())?Number(e):e}):/^[+-]?\d+$/.test(l)?Number(l):l,n[u.toLowerCase()]=h;break;case"BYDAY":var d=void 0,y=void 0,f=void 0,c=l.split(",");n.byweekday=[];for(var p=0;p<c.length;p++)if(2===(f=c[p]).length)y=r.Days[f],n.byweekday.push(y);else{var b=f.match(/^([+-]?\d)([A-Z]{2})$/);d=Number(b[1]);var m=b[2];y=r.Days[m].weekday,n.byweekday.push(new a.default(y,d))}break;case"DTSTART":n.dtstart=i.default.untilStringToDate(l);break;case"UNTIL":n.until=i.default.untilStringToDate(l);break;case"BYEASTER":n.byeaster=Number(l);break;default:throw new Error("Unknown RRULE property '"+u+"'")}}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),a=n(0),i=n(3),s=n(1);t.optionsToString=function(e){for(var t=[],n=Object.keys(e),o=Object.keys(r.DEFAULT_OPTIONS),u=0;u<n.length;u++)if(a.includes(o,n[u])){var l=n[u].toUpperCase(),h=e[n[u]],d=[];if(a.isPresent(h)&&(!a.isArray(h)||h.length)){switch(l){case"FREQ":h=r.default.FREQUENCIES[e.freq];break;case"WKST":a.isNumber(h)&&(h=new i.default(h));break;case"BYWEEKDAY":l="BYDAY",a.isArray(h)||(h=[h]);for(var y=0;y<h.length;y++){var f=h[y];f instanceof i.default||(f=a.isArray(f)?new i.default(f[0],f[1]):new i.default(f)),d[y]=f.toString()}h=d;break;case"DTSTART":case"UNTIL":h=s.default.timeToUntilString(h);break;default:if(a.isArray(h)){for(var c=0;c<h.length;c++)d[c]=String(h[c]);h=d}else h=String(h)}t.push([l,h])}}for(var p=[],b=0;b<t.length;b++){var m=t[b];p.push(m[0]+"="+m[1].toString())}return p.join(";")}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(5),i=n(1),s=n(0),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.all=!1,this.before=[],this.after=[],this.between=[]}return r(e,[{key:"_cacheAdd",value:function(e,t,n){t&&(t=t instanceof Date?i.default.clone(t):i.default.cloneDates(t)),"all"===e?this.all=t:(n._value=t,this[e].push(n))}},{key:"_cacheGet",value:function(e,t){var n=!1,r=t?Object.keys(t):[],o=function(e){for(var n=0;n<r.length;n++){var a=r[n];if(String(t[a])!==String(e[a]))return!0}return!1},u=this[e];if("all"===e)n=this.all;else if(s.isArray(u))for(var l=0;l<u.length;l++){var h=u[l];if(!r.length||!o(h)){n=h._value;break}}if(!n&&this.all){for(var d=new a.default(e,t),y=0;y<this.all.length&&d.accept(this.all[y]);y++);n=d.getValue(),this._cacheAdd(e,n,t)}return s.isArray(n)?i.default.cloneDates(n):n instanceof Date?i.default.clone(n):n}}]),e}();t.Cache=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),a=n(18);t.parseText=a.default;var i=n(4),s=n(7);t.fromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.default;return new i.default(a.default(e,t)||void 0)};var o=["count","until","interval","byweekday","bymonthday","bymonth"];r.default.IMPLEMENTED=[],r.default.IMPLEMENTED[i.default.HOURLY]=o,r.default.IMPLEMENTED[i.default.MINUTELY]=o,r.default.IMPLEMENTED[i.default.DAILY]=["byhour"].concat(o),r.default.IMPLEMENTED[i.default.WEEKLY]=o,r.default.IMPLEMENTED[i.default.MONTHLY]=o,r.default.IMPLEMENTED[i.default.YEARLY]=["byweekno","byyearday"].concat(o);t.toText=function(e,t,n){return new r.default(e,t,n).toString()};var u=r.default.isFullyConvertible;t.isFullyConvertible=u},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),i=n(4),s=n(0),o=function(e,t){return-1!==e.indexOf(t)},u=function(e){return e.toString()},l=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.default;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=[],this.language=r||a.default,this.gettext=n,this.rrule=t,this.options=t.options,this.origOptions=t.origOptions,this.origOptions.bymonthday){var i=[].concat(this.options.bymonthday),o=[].concat(this.options.bynmonthday);i.sort(function(e,t){return e-t}),o.sort(function(e,t){return t-e}),this.bymonthday=i.concat(o),this.bymonthday.length||(this.bymonthday=null)}if(s.isPresent(this.origOptions.byweekday)){var l=s.isArray(this.origOptions.byweekday)?this.origOptions.byweekday:[this.origOptions.byweekday],h=String(l);this.byweekday={allWeeks:l.filter(function(e){return!e.n}),someWeeks:l.filter(function(e){return Boolean(e.n)}),isWeekdays:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1===h.indexOf("SA")&&-1===h.indexOf("SU"),isEveryDay:-1!==h.indexOf("MO")&&-1!==h.indexOf("TU")&&-1!==h.indexOf("WE")&&-1!==h.indexOf("TH")&&-1!==h.indexOf("FR")&&-1!==h.indexOf("SA")&&-1!==h.indexOf("SU")};var d=function(e,t){return e.weekday-t.weekday};this.byweekday.allWeeks.sort(d),this.byweekday.someWeeks.sort(d),this.byweekday.allWeeks.length||(this.byweekday.allWeeks=null),this.byweekday.someWeeks.length||(this.byweekday.someWeeks=null)}else this.byweekday=null}return r(e,[{key:"isFullyConvertible",value:function(){return e.isFullyConvertible(this.rrule)}},{key:"toString",value:function(){var t=this.gettext;if(!(this.options.freq in e.IMPLEMENTED))return t("RRule error: Unable to fully convert this rrule to text");if(this.text=[t("every")],this[i.default.FREQUENCIES[this.options.freq]](),this.options.until){this.add(t("until"));var n=this.options.until;this.add(this.language.monthNames[n.getUTCMonth()]).add(n.getUTCDate()+",").add(n.getUTCFullYear().toString())}else this.options.count&&this.add(t("for")).add(this.options.count.toString()).add(this.plural(this.options.count)?t("times"):t("time"));return this.isFullyConvertible()||this.add(t("(~ approximate)")),this.text.join("")}},{key:"HOURLY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("hours"):e("hour"))}},{key:"MINUTELY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.add((this.plural(this.options.interval),e("minutes")))}},{key:"DAILY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()),this.byweekday&&this.byweekday.isWeekdays?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(this.plural(this.options.interval)?e("days"):e("day")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday?this._byweekday():this.origOptions.byhour&&this._byhour()}},{key:"WEEKLY",value:function(){var e=this.gettext;1!==this.options.interval&&this.add(this.options.interval.toString()).add(this.plural(this.options.interval)?e("weeks"):e("week")),this.byweekday&&this.byweekday.isWeekdays?1===this.options.interval?this.add(this.plural(this.options.interval)?e("weekdays"):e("weekday")):this.add(e("on")).add(e("weekdays")):this.byweekday&&this.byweekday.isEveryDay?this.add(this.plural(this.options.interval)?e("days"):e("day")):(1===this.options.interval&&this.add(e("week")),this.origOptions.bymonth&&(this.add(e("in")),this._bymonth()),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday())}},{key:"MONTHLY",value:function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()).add(e("months")),this.plural(this.options.interval)&&this.add(e("in"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("months"):e("month"))),this.bymonthday?this._bymonthday():this.byweekday&&this.byweekday.isWeekdays?this.add(e("on")).add(e("weekdays")):this.byweekday&&this._byweekday()}},{key:"YEARLY",value:function(){var e=this.gettext;this.origOptions.bymonth?(1!==this.options.interval&&(this.add(this.options.interval.toString()),this.add(e("years"))),this._bymonth()):(1!==this.options.interval&&this.add(this.options.interval.toString()),this.add(this.plural(this.options.interval)?e("years"):e("year"))),this.bymonthday?this._bymonthday():this.byweekday&&this._byweekday(),this.options.byyearday&&this.add(e("on the")).add(this.list(this.options.byyearday,this.nth,e("and"))).add(e("day")),this.options.byweekno&&this.add(e("in")).add(this.plural(this.options.byweekno.length)?e("weeks"):e("week")).add(this.list(this.options.byweekno,void 0,e("and")))}},{key:"_bymonthday",value:function(){var e=this.gettext;this.byweekday&&this.byweekday.allWeeks?this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext,e("or"))).add(e("the")).add(this.list(this.bymonthday,this.nth,e("or"))):this.add(e("on the")).add(this.list(this.bymonthday,this.nth,e("and")))}},{key:"_byweekday",value:function(){var e=this.gettext;this.byweekday.allWeeks&&!this.byweekday.isWeekdays&&this.add(e("on")).add(this.list(this.byweekday.allWeeks,this.weekdaytext)),this.byweekday.someWeeks&&(this.byweekday.allWeeks&&this.add(e("and")),this.add(e("on the")).add(this.list(this.byweekday.someWeeks,this.weekdaytext,e("and"))))}},{key:"_byhour",value:function(){var e=this.gettext;this.add(e("at")).add(this.list(this.origOptions.byhour,void 0,e("and")))}},{key:"_bymonth",value:function(){this.add(this.list(this.options.bymonth,this.monthtext,this.gettext("and")))}},{key:"nth",value:function(e){e=parseInt(e.toString(),10);var t,n=void 0,r=this.gettext;if(-1===e)return r("last");switch(t=Math.abs(e)){case 1:case 21:case 31:n=t+r("st");break;case 2:case 22:n=t+r("nd");break;case 3:case 23:n=t+r("rd");break;default:n=t+r("th")}return e<0?n+" "+r("last"):n}},{key:"monthtext",value:function(e){return this.language.monthNames[e-1]}},{key:"weekdaytext",value:function(e){var t=s.isNumber(e)?(e+1)%7:e.getJsWeekday();return(e.n?this.nth(e.n)+" ":"")+this.language.dayNames[t]}},{key:"plural",value:function(e){return e%100!=1}},{key:"add",value:function(e){return this.text.push(" "),this.text.push(e),this}},{key:"list",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";s.isArray(e)||(e=[e]);t=t||function(e){return e.toString()};var a=this,i=function(e){return t&&t.call(a,e)};return n?function(e,t,n){for(var r="",a=0;a<e.length;a++)0!==a&&(a===e.length-1?r+=" "+n+" ":r+=t+" "),r+=e[a];return r}(e.map(i),r,n):e.map(i).join(r+" ")}}],[{key:"isFullyConvertible",value:function(t){if(!(t.options.freq in e.IMPLEMENTED))return!1;if(t.origOptions.until&&t.origOptions.count)return!1;for(var n in t.origOptions){if(o(["dtstart","wkst","freq"],n))return!0;if(!o(e.IMPLEMENTED[t.options.freq],n))return!1}return!0}}]),e}();t.default=l},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),i=n(4),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.done=!0,this.rules=t}return r(e,[{key:"start",value:function(e){return this.text=e,this.done=!1,this.nextSymbol()}},{key:"isDone",value:function(){return this.done&&null===this.symbol}},{key:"nextSymbol",value:function(){var e=void 0,t=void 0;this.symbol=null,this.value=null;do{if(this.done)return!1;for(var n in e=null,this.rules){var r=this.rules[n].exec(this.text);r&&(null===e||r[0].length>e[0].length)&&(e=r,t=n)}if(null!=e&&(this.text=this.text.substr(e[0].length),""===this.text&&(this.done=!0)),null==e)return this.done=!0,this.symbol=null,void(this.value=null)}while("SKIP"===t);return this.symbol=t,this.value=e,!0}},{key:"accept",value:function(e){if(this.symbol===e){if(this.value){var t=this.value;return this.nextSymbol(),t}return this.nextSymbol(),!0}return!1}},{key:"acceptNumber",value:function(){return this.accept("number")}},{key:"expect",value:function(e){if(this.accept(e))return!0;throw new Error("expected "+e+" but found "+this.symbol)}}]),e}();t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.default,n={},r=new s(t.tokens);return r.start(e)?(function(){r.expect("every");var e=r.acceptNumber();if(e&&(n.interval=parseInt(e[0],10)),r.isDone())throw new Error("Unexpected end");switch(r.symbol){case"day(s)":n.freq=i.default.DAILY,r.nextSymbol()&&(function(){if(r.accept("at"))do{var e=r.acceptNumber();if(!e)throw new Error("Unexpected symbol "+r.symbol+", expected hour");for(n.byhour=[parseInt(e[0],10)];r.accept("comma");){if(!(e=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected hour");n.byhour.push(parseInt(e[0],10))}}while(r.accept("comma")||r.accept("at"))}(),d());break;case"weekday(s)":n.freq=i.default.WEEKLY,n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR],r.nextSymbol(),d();break;case"week(s)":n.freq=i.default.WEEKLY,r.nextSymbol()&&(o(),d());break;case"hour(s)":n.freq=i.default.HOURLY,r.nextSymbol()&&(o(),d());break;case"minute(s)":n.freq=i.default.MINUTELY,r.nextSymbol()&&(o(),d());break;case"month(s)":n.freq=i.default.MONTHLY,r.nextSymbol()&&(o(),d());break;case"year(s)":n.freq=i.default.YEARLY,r.nextSymbol()&&(o(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":n.freq=i.default.WEEKLY;var t=r.symbol.substr(0,2).toUpperCase();if(n.byweekday=[i.default[t]],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var a=l();if(!a)throw new Error("Unexpected symbol "+r.symbol+", expected weekday");n.byweekday.push(i.default[a]),r.nextSymbol()}!function(){r.accept("on"),r.accept("the");var e=h();if(e)for(n.bymonthday=[e],r.nextSymbol();r.accept("comma");){if(!(e=h()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.bymonthday.push(e),r.nextSymbol()}}(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(n.freq=i.default.YEARLY,n.bymonth=[u()],!r.nextSymbol())return;for(;r.accept("comma");){if(r.isDone())throw new Error("Unexpected end");var s=u();if(!s)throw new Error("Unexpected symbol "+r.symbol+", expected month");n.bymonth.push(s),r.nextSymbol()}o(),d();break;default:throw new Error("Unknown symbol")}}(),n):null;function o(){var e=r.accept("on"),t=r.accept("the");if(e||t)do{var a=h(),s=l(),o=u();if(a)s?(r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[s].nth(a))):(n.bymonthday||(n.bymonthday=[]),n.bymonthday.push(a),r.accept("day(s)"));else if(s)r.nextSymbol(),n.byweekday||(n.byweekday=[]),n.byweekday.push(i.default[s]);else if("weekday(s)"===r.symbol)r.nextSymbol(),n.byweekday||(n.byweekday=[i.default.MO,i.default.TU,i.default.WE,i.default.TH,i.default.FR]);else if("week(s)"===r.symbol){r.nextSymbol();var d=r.acceptNumber();if(!d)throw new Error("Unexpected symbol "+r.symbol+", expected week number");for(n.byweekno=[parseInt(d[0],10)];r.accept("comma");){if(!(d=r.acceptNumber()))throw new Error("Unexpected symbol "+r.symbol+"; expected monthday");n.byweekno.push(parseInt(d[0],10))}}else{if(!o)return;r.nextSymbol(),n.bymonth||(n.bymonth=[]),n.bymonth.push(o)}}while(r.accept("comma")||r.accept("the")||r.accept("on"))}function u(){switch(r.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function l(){switch(r.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return r.symbol.substr(0,2).toUpperCase();default:return!1}}function h(){switch(r.symbol){case"last":return r.nextSymbol(),-1;case"first":return r.nextSymbol(),1;case"second":return r.nextSymbol(),r.accept("last")?-2:2;case"third":return r.nextSymbol(),r.accept("last")?-3:3;case"nth":var e=parseInt(r.value[1],10);if(e<-366||e>366)throw new Error("Nth out of range: "+e);return r.nextSymbol(),r.accept("last")?-e:e;default:return!1}}function d(){if("until"===r.symbol){var e=Date.parse(r.text);if(!e)throw new Error("Cannot parse until date:"+r.text);n.until=new Date(e)}else r.accept("for")&&(n.count=parseInt(r.value[0],10),r.expect("number"))}}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),i=n(8),s=n(1),o=n(3),u=n(0),l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._handle_BYDAY=this._handle_BYWEEKDAY,this._handle_INTERVAL=this._handle_int,this._handle_COUNT=this._handle_int,this._handle_BYSETPOS=this._handle_int_list,this._handle_BYMONTH=this._handle_int_list,this._handle_BYMONTHDAY=this._handle_int_list,this._handle_BYYEARDAY=this._handle_int_list,this._handle_BYEASTER=this._handle_int_list,this._handle_BYWEEKNO=this._handle_int_list,this._handle_BYHOUR=this._handle_int_list,this._handle_BYMINUTE=this._handle_int_list,this._handle_BYSECOND=this._handle_int_list}return r(e,[{key:"_handle_DTSTART",value:function(e,t,n,r){e.dtstart=s.default.untilStringToDate(n)}},{key:"_handle_int",value:function(e,t,n){e[t.toLowerCase()]=parseInt(n,10)}},{key:"_handle_int_list",value:function(e,t,n){e[t.toLowerCase()]=n.split(",").map(function(e){return parseInt(e,10)})}},{key:"_handle_FREQ",value:function(t,n,r,a){t.freq=e._freq_map[r]}},{key:"_handle_UNTIL",value:function(e,t,n,r){try{e.until=s.default.untilStringToDate(n)}catch(e){throw new Error("invalid until date")}}},{key:"_handle_WKST",value:function(t,n,r,a){t.wkst=e._weekday_map[r]}},{key:"_handle_BYWEEKDAY",value:function(t,n,r,a){var i=void 0,s=void 0,u=void 0,l=void 0,h=void 0,d=void 0,y=[],f=r.split(",");for(s=0;s<f.length;s++){if((d=f[s]).indexOf("(")>-1)h=(i=d.split("("))[0],l=parseInt(i.slice(1,-1)[0],10);else{for(u=0;u<d.length&&-1!=="+-0123456789".indexOf(d[u]);u++);l=d.slice(0,u)||null,h=d.slice(u),l&&(l=parseInt(l,10))}var c=new o.default(e._weekday_map[h],l);y.push(c)}t.byweekday=y}},{key:"_parseRfcRRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.dtstart=t.dtstart||null,t.cache=t.cache||!1;var n=void 0,r=void 0,i=void 0;if(-1!==e.indexOf(":")){if(n=(i=e.split(":"))[0],r=i[1],"RRULE"!==n)throw new Error("unknown parameter name")}else r=e;for(var s={},o=r.split(";"),u=0;u<o.length;u++){n=(i=o[u].split("="))[0].toUpperCase(),r=i[1].toUpperCase();try{this["_handle_"+n](s,n,r)}catch(e){throw new Error("unknown parameter '"+n+"':"+r)}}return s.dtstart=s.dtstart||t.dtstart,new a.default(s,!t.cache)}},{key:"_parseRfc",value:function(e,t){if(t.compatible&&(t.forceset=!0,t.unfold=!0),!(e=e&&e.toUpperCase().trim()))throw new Error("Invalid empty string");var n=0,r=void 0,a=void 0;if(t.unfold)for(a=e.split("\n");n<a.length;)(r=a[n]=a[n].replace(/\s+$/g,""))?n>0&&" "===r[0]?(a[n-1]+=r.slice(1),a.splice(n,1)):n+=1:a.splice(n,1);else a=e.split(/\s/);var o=[],l=[],h=[],d=[],y=void 0,f=void 0,c=void 0,p=void 0,b=void 0,m=void 0,v=void 0,w=void 0,k=void 0;if(t.forceset||1!==a.length||-1!==e.indexOf(":")&&0!==e.indexOf("RRULE:")){for(var g=0;g<a.length;g++)if(r=a[g]){-1===r.indexOf(":")?(y="RRULE",f=r):(y=(c=u.split(r,":",1))[0],f=c[1]);var E=y.split(";");if(!E)throw new Error("empty property name");if(y=E[0],E=E.slice(1),"RRULE"===y){for(m=0;m<E.length;m++){var _=E[m];throw new Error("unsupported RRULE parm: "+_)}o.push(f)}else if("RDATE"===y){for(m=0;m<E.length;m++){var T=E[m];if("VALUE=DATE-TIME"!==T&&"VALUE=DATE"!==T)throw new Error("unsupported RDATE parm: "+T)}l.push(f)}else if("EXRULE"===y){for(m=0;m<E.length;m++){var O=E[m];throw new Error("unsupported EXRULE parm: "+O)}h.push(f)}else if("EXDATE"===y){for(m=0;m<E.length;m++){var Y=E[m];if("VALUE=DATE-TIME"!==Y&&"VALUE=DATE"!==Y)throw new Error("unsupported EXDATE parm: "+Y)}d.push(f)}else{if("DTSTART"!==y)throw new Error("unsupported property: "+y);p=s.default.untilStringToDate(f)}}if(t.forceset||o.length>1||l.length||h.length||d.length){for(b=new i.default(!t.cache),m=0;m<o.length;m++)b.rrule(this._parseRfcRRule(o[m],{dtstart:t.dtstart||p}));for(m=0;m<l.length;m++)for(w=l[m].split(","),v=0;v<w.length;v++)k=w[v],b.rdate(s.default.untilStringToDate(k));for(m=0;m<h.length;m++)b.exrule(this._parseRfcRRule(h[m],{dtstart:t.dtstart||p}));for(m=0;m<d.length;m++)for(w=d[m].split(","),v=0;v<w.length;v++)k=w[v],b.exdate(s.default.untilStringToDate(k));return t.compatible&&t.dtstart&&b.rdate(p),b}return this._parseRfcRRule(o[0],{dtstart:t.dtstart||p,cache:t.cache})}return this._parseRfcRRule(a[0],{cache:t.cache,dtstart:t.dtstart})}},{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],a=Object.keys(n),i=Object.keys(e.DEFAULT_OPTIONS);if(a.forEach(function(e){u.includes(i,e)||r.push(e)},this),r.length)throw new Error("Invalid options: "+r.join(", "));return i.forEach(function(t){u.includes(a,t)||(n[t]=e.DEFAULT_OPTIONS[t])}),this._parseRfc(t,n)}}]),e}();l._weekday_map={MO:0,TU:1,WE:2,TH:3,FR:4,SA:5,SU:6},l._freq_map={YEARLY:a.default.YEARLY,MONTHLY:a.default.MONTHLY,WEEKLY:a.default.WEEKLY,DAILY:a.default.DAILY,HOURLY:a.default.HOURLY,MINUTELY:a.default.MINUTELY,SECONDLY:a.default.SECONDLY},l.DEFAULT_OPTIONS={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1},t.default=l}])}); |
@@ -70,6 +70,6 @@ /** | ||
class Time { | ||
private hour; | ||
private minute; | ||
private second; | ||
private millisecond; | ||
hour: number; | ||
minute: number; | ||
second: number; | ||
millisecond: number; | ||
constructor(hour: number, minute: number, second: number, millisecond: number); | ||
@@ -82,3 +82,22 @@ getHours(): number; | ||
} | ||
class DateTime extends Time { | ||
day: number; | ||
month: number; | ||
year: number; | ||
constructor(year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number); | ||
getWeekday(): number; | ||
getTime(): number; | ||
getDay(): number; | ||
getMonth(): number; | ||
getYear(): number; | ||
addYears(years: number): void; | ||
addMonths(months: number): void; | ||
addWeekly(days: number, wkst: number): void; | ||
addDaily(days: number): void; | ||
addHours(hours: number, filtered: boolean, byhour: number[]): boolean; | ||
addMinutes(minutes: number, filtered: boolean, byhour: number[], byminute: number[]): boolean; | ||
addSeconds(seconds: number, filtered: boolean, byhour: number[], byminute: number[], bysecond: number[]): boolean; | ||
fixDay(): void; | ||
} | ||
} | ||
export default dateutil; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const helpers_1 = require("./helpers"); | ||
/** | ||
@@ -119,6 +120,5 @@ * General date-related utilities. | ||
dateutil.timeToUntilString = function (time) { | ||
let comp; | ||
const date = new Date(time); | ||
const comps = [ | ||
date.getUTCFullYear(), | ||
return [ | ||
helpers_1.padStart(date.getUTCFullYear().toString(), 4, '0'), | ||
date.getUTCMonth() + 1, | ||
@@ -131,10 +131,6 @@ date.getUTCDate(), | ||
'Z' | ||
]; | ||
for (let i = 0; i < comps.length; i++) { | ||
comp = comps[i]; | ||
if (!/[TZ]/.test(comp.toString()) && comp < 10) { | ||
comps[i] = '0' + String(comp); | ||
} | ||
} | ||
return comps.join(''); | ||
].map(value => value.toString()) | ||
.map(value => /[TZ]/.test(value) ? | ||
value : | ||
helpers_1.padStart(value, 2, '0')).join(''); | ||
}; | ||
@@ -173,4 +169,140 @@ dateutil.untilStringToDate = function (until) { | ||
dateutil.Time = Time; | ||
class DateTime extends Time { | ||
constructor(year, month, day, hour, minute, second, millisecond) { | ||
super(hour, minute, second, millisecond); | ||
this.year = year; | ||
this.month = month; | ||
this.day = day; | ||
} | ||
getWeekday() { | ||
return dateutil.getWeekday(new Date(this.getTime())); | ||
} | ||
getTime() { | ||
return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime(); | ||
} | ||
getDay() { | ||
return this.day; | ||
} | ||
getMonth() { | ||
return this.month; | ||
} | ||
getYear() { | ||
return this.year; | ||
} | ||
addYears(years) { | ||
this.year += years; | ||
} | ||
addMonths(months) { | ||
this.month += months; | ||
if (this.month > 12) { | ||
const yearDiv = Math.floor(this.month / 12); | ||
const monthMod = helpers_1.pymod(this.month, 12); | ||
this.month = monthMod; | ||
this.year += yearDiv; | ||
if (this.month === 0) { | ||
this.month = 12; | ||
--this.year; | ||
} | ||
} | ||
} | ||
addWeekly(days, wkst) { | ||
if (wkst > this.getWeekday()) { | ||
this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7; | ||
} | ||
else { | ||
this.day += -(this.getWeekday() - wkst) + days * 7; | ||
} | ||
this.fixDay(); | ||
} | ||
addDaily(days) { | ||
this.day += days; | ||
this.fixDay(); | ||
} | ||
addHours(hours, filtered, byhour) { | ||
let fixday = false; | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
this.hour += Math.floor((23 - this.hour) / hours) * hours; | ||
} | ||
while (true) { | ||
this.hour += hours; | ||
const { div: dayDiv, mod: hourMod } = helpers_1.divmod(this.hour, 24); | ||
if (dayDiv) { | ||
this.hour = hourMod; | ||
this.addDaily(dayDiv); | ||
fixday = true; | ||
} | ||
if (helpers_1.empty(byhour) || helpers_1.includes(byhour, this.hour)) | ||
break; | ||
} | ||
return fixday; | ||
} | ||
addMinutes(minutes, filtered, byhour, byminute) { | ||
let fixday = false; | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
this.minute += | ||
Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes; | ||
} | ||
while (true) { | ||
this.minute += minutes; | ||
const { div: hourDiv, mod: minuteMod } = helpers_1.divmod(this.minute, 60); | ||
if (hourDiv) { | ||
this.minute = minuteMod; | ||
fixday = this.addHours(hourDiv, false, byhour); | ||
} | ||
if ((helpers_1.empty(byhour) || helpers_1.includes(byhour, this.hour)) && | ||
(helpers_1.empty(byminute) || helpers_1.includes(byminute, this.minute))) { | ||
break; | ||
} | ||
} | ||
return fixday; | ||
} | ||
addSeconds(seconds, filtered, byhour, byminute, bysecond) { | ||
let fixday = false; | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
this.second += | ||
Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) / seconds) * seconds; | ||
} | ||
while (true) { | ||
this.second += seconds; | ||
const { div: minuteDiv, mod: secondMod } = helpers_1.divmod(this.second, 60); | ||
if (minuteDiv) { | ||
this.second = secondMod; | ||
fixday = this.addMinutes(minuteDiv, false, byhour, byminute); | ||
} | ||
if ((helpers_1.empty(byhour) || helpers_1.includes(byhour, this.hour)) && | ||
(helpers_1.empty(byminute) || helpers_1.includes(byminute, this.minute)) && | ||
(helpers_1.empty(bysecond) || helpers_1.includes(bysecond, this.second))) { | ||
break; | ||
} | ||
} | ||
return fixday; | ||
} | ||
fixDay() { | ||
if (this.day <= 28) { | ||
return; | ||
} | ||
let daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1]; | ||
if (this.day <= daysinmonth) { | ||
return; | ||
} | ||
while (this.day > daysinmonth) { | ||
this.day -= daysinmonth; | ||
++this.month; | ||
if (this.month === 13) { | ||
this.month = 1; | ||
++this.year; | ||
if (this.year > dateutil.MAXYEAR) { | ||
return; | ||
} | ||
} | ||
daysinmonth = dateutil.monthRange(this.year, this.month - 1)[1]; | ||
} | ||
} | ||
} | ||
dateutil.DateTime = DateTime; | ||
})(dateutil = exports.dateutil || (exports.dateutil = {})); | ||
exports.default = dateutil; | ||
//# sourceMappingURL=dateutil.js.map |
@@ -10,2 +10,3 @@ export declare const isPresent: <T>(value?: T | null | undefined) => value is T; | ||
export declare const repeat: <T>(value: T | T[], times: number) => (T | T[])[]; | ||
export declare function padStart(str: string, targetLength: number, padString?: string): string; | ||
/** | ||
@@ -12,0 +13,0 @@ * Python like split |
@@ -42,2 +42,14 @@ "use strict"; | ||
}; | ||
function padStart(str, targetLength, padString = ' ') { | ||
targetLength = targetLength >> 0; | ||
if (str.length > targetLength) { | ||
return String(str); | ||
} | ||
targetLength = targetLength - str.length; | ||
if (targetLength > padString.length) { | ||
padString += exports.repeat(padString, targetLength / padString.length); | ||
} | ||
return padString.slice(0, targetLength) + String(str); | ||
} | ||
exports.padStart = padStart; | ||
/** | ||
@@ -44,0 +56,0 @@ * Python like split |
@@ -24,2 +24,4 @@ import RRule from './rrule'; | ||
rebuild(year: number, month: number): void; | ||
private rebuildYear; | ||
private rebuildMonth; | ||
ydayset(): (number | number[])[]; | ||
@@ -26,0 +28,0 @@ mdayset(_: any, month: number, __: any): (number | (number | null)[])[]; |
@@ -46,67 +46,95 @@ "use strict"; | ||
if (year !== this.lastyear) { | ||
this.yearlen = dateutil_1.default.isLeapYear(year) ? 366 : 365; | ||
this.nextyearlen = dateutil_1.default.isLeapYear(year + 1) ? 366 : 365; | ||
const firstyday = new Date(Date.UTC(year, 0, 1)); | ||
this.yearordinal = dateutil_1.default.toOrdinal(firstyday); | ||
this.yearweekday = dateutil_1.default.getWeekday(firstyday); | ||
const wday = dateutil_1.default.getWeekday(firstyday); | ||
if (this.yearlen === 365) { | ||
this.mmask = helpers_1.clone(masks_1.M365MASK); | ||
this.mdaymask = helpers_1.clone(masks_1.MDAY365MASK); | ||
this.nmdaymask = helpers_1.clone(masks_1.NMDAY365MASK); | ||
this.wdaymask = masks_1.WDAYMASK.slice(wday); | ||
this.mrange = helpers_1.clone(masks_1.M365RANGE); | ||
this.rebuildYear(year); | ||
} | ||
if (helpers_1.notEmpty(rr.options.bynweekday) && | ||
(month !== this.lastmonth || year !== this.lastyear)) { | ||
this.rebuildMonth(year, month); | ||
} | ||
if (helpers_1.isPresent(rr.options.byeaster)) { | ||
this.eastermask = this.easter(year, rr.options.byeaster); | ||
} | ||
} | ||
rebuildYear(year) { | ||
const rr = this.rrule; | ||
this.yearlen = dateutil_1.default.isLeapYear(year) ? 366 : 365; | ||
this.nextyearlen = dateutil_1.default.isLeapYear(year + 1) ? 366 : 365; | ||
const firstyday = new Date(Date.UTC(year, 0, 1)); | ||
this.yearordinal = dateutil_1.default.toOrdinal(firstyday); | ||
this.yearweekday = dateutil_1.default.getWeekday(firstyday); | ||
const wday = dateutil_1.default.getWeekday(firstyday); | ||
if (this.yearlen === 365) { | ||
this.mmask = masks_1.M365MASK; | ||
this.mdaymask = masks_1.MDAY365MASK; | ||
this.nmdaymask = masks_1.NMDAY365MASK; | ||
this.wdaymask = masks_1.WDAYMASK.slice(wday); | ||
this.mrange = masks_1.M365RANGE; | ||
} | ||
else { | ||
this.mmask = masks_1.M366MASK; | ||
this.mdaymask = masks_1.MDAY366MASK; | ||
this.nmdaymask = masks_1.NMDAY366MASK; | ||
this.wdaymask = masks_1.WDAYMASK.slice(wday); | ||
this.mrange = masks_1.M366RANGE; | ||
} | ||
if (helpers_1.empty(rr.options.byweekno)) { | ||
this.wnomask = null; | ||
} | ||
else { | ||
this.wnomask = helpers_1.repeat(0, this.yearlen + 7); | ||
let no1wkst; | ||
let firstwkst; | ||
let wyearlen; | ||
no1wkst = firstwkst = helpers_1.pymod(7 - this.yearweekday + rr.options.wkst, 7); | ||
if (no1wkst >= 4) { | ||
no1wkst = 0; | ||
// Number of days in the year, plus the days we got | ||
// from last year. | ||
wyearlen = | ||
this.yearlen + helpers_1.pymod(this.yearweekday - rr.options.wkst, 7); | ||
} | ||
else { | ||
this.mmask = helpers_1.clone(masks_1.M366MASK); | ||
this.mdaymask = helpers_1.clone(masks_1.MDAY366MASK); | ||
this.nmdaymask = helpers_1.clone(masks_1.NMDAY366MASK); | ||
this.wdaymask = masks_1.WDAYMASK.slice(wday); | ||
this.mrange = helpers_1.clone(masks_1.M366RANGE); | ||
// Number of days in the year, minus the days we | ||
// left in last year. | ||
wyearlen = this.yearlen - no1wkst; | ||
} | ||
if (helpers_1.empty(rr.options.byweekno)) { | ||
this.wnomask = null; | ||
} | ||
else { | ||
this.wnomask = helpers_1.repeat(0, this.yearlen + 7); | ||
let no1wkst; | ||
let firstwkst; | ||
let wyearlen; | ||
no1wkst = firstwkst = helpers_1.pymod(7 - this.yearweekday + rr.options.wkst, 7); | ||
if (no1wkst >= 4) { | ||
no1wkst = 0; | ||
// Number of days in the year, plus the days we got | ||
// from last year. | ||
wyearlen = | ||
this.yearlen + helpers_1.pymod(this.yearweekday - rr.options.wkst, 7); | ||
const div = Math.floor(wyearlen / 7); | ||
const mod = helpers_1.pymod(wyearlen, 7); | ||
const numweeks = Math.floor(div + mod / 4); | ||
for (let j = 0; j < rr.options.byweekno.length; j++) { | ||
let i; | ||
let n = rr.options.byweekno[j]; | ||
if (n < 0) { | ||
n += numweeks + 1; | ||
} | ||
if (!(n > 0 && n <= numweeks)) { | ||
continue; | ||
} | ||
if (n > 1) { | ||
i = no1wkst + (n - 1) * 7; | ||
if (no1wkst !== firstwkst) { | ||
i -= 7 - firstwkst; | ||
} | ||
} | ||
else { | ||
// Number of days in the year, minus the days we | ||
// left in last year. | ||
wyearlen = this.yearlen - no1wkst; | ||
i = no1wkst; | ||
} | ||
const div = Math.floor(wyearlen / 7); | ||
const mod = helpers_1.pymod(wyearlen, 7); | ||
const numweeks = Math.floor(div + mod / 4); | ||
for (let j = 0; j < rr.options.byweekno.length; j++) { | ||
let i; | ||
let n = rr.options.byweekno[j]; | ||
if (n < 0) { | ||
n += numweeks + 1; | ||
} | ||
if (!(n > 0 && n <= numweeks)) { | ||
continue; | ||
} | ||
if (n > 1) { | ||
i = no1wkst + (n - 1) * 7; | ||
if (no1wkst !== firstwkst) { | ||
i -= 7 - firstwkst; | ||
} | ||
} | ||
else { | ||
i = no1wkst; | ||
} | ||
for (let k = 0; k < 7; k++) { | ||
for (let k = 0; k < 7; k++) { | ||
this.wnomask[i] = 1; | ||
i++; | ||
if (this.wdaymask[i] === rr.options.wkst) | ||
break; | ||
} | ||
} | ||
if (helpers_1.includes(rr.options.byweekno, 1)) { | ||
// Check week number 1 of next year as well | ||
// orig-TODO : Check -numweeks for next year. | ||
let i = no1wkst + numweeks * 7; | ||
if (no1wkst !== firstwkst) | ||
i -= 7 - firstwkst; | ||
if (i < this.yearlen) { | ||
// If week starts in next year, we | ||
// don't care about it. | ||
for (let j = 0; j < 7; j++) { | ||
this.wnomask[i] = 1; | ||
i++; | ||
i += 1; | ||
if (this.wdaymask[i] === rr.options.wkst) | ||
@@ -116,100 +144,80 @@ break; | ||
} | ||
if (helpers_1.includes(rr.options.byweekno, 1)) { | ||
// Check week number 1 of next year as well | ||
// orig-TODO : Check -numweeks for next year. | ||
let i = no1wkst + numweeks * 7; | ||
if (no1wkst !== firstwkst) | ||
i -= 7 - firstwkst; | ||
if (i < this.yearlen) { | ||
// If week starts in next year, we | ||
// don't care about it. | ||
for (let j = 0; j < 7; j++) { | ||
this.wnomask[i] = 1; | ||
i += 1; | ||
if (this.wdaymask[i] === rr.options.wkst) | ||
break; | ||
} | ||
} | ||
if (no1wkst) { | ||
// Check last week number of last year as | ||
// well. If no1wkst is 0, either the year | ||
// started on week start, or week number 1 | ||
// got days from last year, so there are no | ||
// days from last year's last week number in | ||
// this year. | ||
let lnumweeks; | ||
if (!helpers_1.includes(rr.options.byweekno, -1)) { | ||
const lyearweekday = dateutil_1.default.getWeekday(new Date(Date.UTC(year - 1, 0, 1))); | ||
let lno1wkst = helpers_1.pymod(7 - lyearweekday.valueOf() + rr.options.wkst, 7); | ||
const lyearlen = dateutil_1.default.isLeapYear(year - 1) ? 366 : 365; | ||
if (lno1wkst >= 4) { | ||
lno1wkst = 0; | ||
lnumweeks = Math.floor(52 + | ||
helpers_1.pymod(lyearlen + helpers_1.pymod(lyearweekday - rr.options.wkst, 7), 7) / | ||
4); | ||
} | ||
} | ||
if (no1wkst) { | ||
// Check last week number of last year as | ||
// well. If no1wkst is 0, either the year | ||
// started on week start, or week number 1 | ||
// got days from last year, so there are no | ||
// days from last year's last week number in | ||
// this year. | ||
let lnumweeks; | ||
if (!helpers_1.includes(rr.options.byweekno, -1)) { | ||
const lyearweekday = dateutil_1.default.getWeekday(new Date(Date.UTC(year - 1, 0, 1))); | ||
let lno1wkst = helpers_1.pymod(7 - lyearweekday.valueOf() + rr.options.wkst, 7); | ||
const lyearlen = dateutil_1.default.isLeapYear(year - 1) ? 366 : 365; | ||
if (lno1wkst >= 4) { | ||
lno1wkst = 0; | ||
lnumweeks = Math.floor(52 + | ||
helpers_1.pymod(lyearlen + helpers_1.pymod(lyearweekday - rr.options.wkst, 7), 7) / | ||
4); | ||
} | ||
else { | ||
lnumweeks = Math.floor(52 + helpers_1.pymod(this.yearlen - no1wkst, 7) / 4); | ||
} | ||
} | ||
else { | ||
lnumweeks = -1; | ||
lnumweeks = Math.floor(52 + helpers_1.pymod(this.yearlen - no1wkst, 7) / 4); | ||
} | ||
if (helpers_1.includes(rr.options.byweekno, lnumweeks)) { | ||
for (let i = 0; i < no1wkst; i++) | ||
this.wnomask[i] = 1; | ||
} | ||
} | ||
else { | ||
lnumweeks = -1; | ||
} | ||
if (helpers_1.includes(rr.options.byweekno, lnumweeks)) { | ||
for (let i = 0; i < no1wkst; i++) | ||
this.wnomask[i] = 1; | ||
} | ||
} | ||
} | ||
if (helpers_1.notEmpty(rr.options.bynweekday) && | ||
(month !== this.lastmonth || year !== this.lastyear)) { | ||
let ranges = []; | ||
if (rr.options.freq === rrule_1.default.YEARLY) { | ||
if (helpers_1.notEmpty(rr.options.bymonth)) { | ||
for (let j = 0; j < rr.options.bymonth.length; j++) { | ||
month = rr.options.bymonth[j]; | ||
ranges.push(this.mrange.slice(month - 1, month + 1)); | ||
} | ||
} | ||
rebuildMonth(year, month) { | ||
const rr = this.rrule; | ||
let ranges = []; | ||
if (rr.options.freq === rrule_1.default.YEARLY) { | ||
if (helpers_1.notEmpty(rr.options.bymonth)) { | ||
for (let j = 0; j < rr.options.bymonth.length; j++) { | ||
month = rr.options.bymonth[j]; | ||
ranges.push(this.mrange.slice(month - 1, month + 1)); | ||
} | ||
else { | ||
ranges = [[0, this.yearlen]]; | ||
} | ||
} | ||
else if (rr.options.freq === rrule_1.default.MONTHLY) { | ||
ranges = [this.mrange.slice(month - 1, month + 1)]; | ||
else { | ||
ranges = [[0, this.yearlen]]; | ||
} | ||
if (helpers_1.notEmpty(ranges)) { | ||
// Weekly frequency won't get here, so we may not | ||
// care about cross-year weekly periods. | ||
this.nwdaymask = helpers_1.repeat(0, this.yearlen); | ||
for (let j = 0; j < ranges.length; j++) { | ||
const rang = ranges[j]; | ||
const first = rang[0]; | ||
let last = rang[1]; | ||
last -= 1; | ||
for (let k = 0; k < rr.options.bynweekday.length; k++) { | ||
let i; | ||
const wday = rr.options.bynweekday[k][0]; | ||
const n = rr.options.bynweekday[k][1]; | ||
if (n < 0) { | ||
i = last + (n + 1) * 7; | ||
i -= helpers_1.pymod(this.wdaymask[i] - wday, 7); | ||
} | ||
else { | ||
i = first + (n - 1) * 7; | ||
i += helpers_1.pymod(7 - this.wdaymask[i] + wday, 7); | ||
} | ||
if (first <= i && i <= last) | ||
this.nwdaymask[i] = 1; | ||
} | ||
else if (rr.options.freq === rrule_1.default.MONTHLY) { | ||
ranges = [this.mrange.slice(month - 1, month + 1)]; | ||
} | ||
if (helpers_1.notEmpty(ranges)) { | ||
// Weekly frequency won't get here, so we may not | ||
// care about cross-year weekly periods. | ||
this.nwdaymask = helpers_1.repeat(0, this.yearlen); | ||
for (let j = 0; j < ranges.length; j++) { | ||
const rang = ranges[j]; | ||
const first = rang[0]; | ||
let last = rang[1]; | ||
last -= 1; | ||
for (let k = 0; k < rr.options.bynweekday.length; k++) { | ||
let i; | ||
const wday = rr.options.bynweekday[k][0]; | ||
const n = rr.options.bynweekday[k][1]; | ||
if (n < 0) { | ||
i = last + (n + 1) * 7; | ||
i -= helpers_1.pymod(this.wdaymask[i] - wday, 7); | ||
} | ||
else { | ||
i = first + (n - 1) * 7; | ||
i += helpers_1.pymod(7 - this.wdaymask[i] + wday, 7); | ||
} | ||
if (first <= i && i <= last) | ||
this.nwdaymask[i] = 1; | ||
} | ||
} | ||
this.lastyear = year; | ||
this.lastmonth = month; | ||
} | ||
if (helpers_1.isPresent(rr.options.byeaster)) { | ||
this.eastermask = this.easter(year, rr.options.byeaster); | ||
} | ||
this.lastyear = year; | ||
this.lastmonth = month; | ||
} | ||
@@ -216,0 +224,0 @@ ydayset() { |
@@ -1,2 +0,2 @@ | ||
import { Cache } from './types'; | ||
import { QueryMethods } from './types'; | ||
export interface IterArgs { | ||
@@ -13,8 +13,9 @@ inc: boolean; | ||
export default class IterResult { | ||
readonly method: keyof Cache; | ||
readonly method: keyof QueryMethods; | ||
readonly args: Partial<IterArgs>; | ||
readonly minDate: Date | null; | ||
readonly maxDate: Date | null; | ||
_result: (Date | Partial<IterArgs>)[]; | ||
constructor(method: keyof Cache, args: Partial<IterArgs>); | ||
_result: Date[]; | ||
total: number; | ||
constructor(method: keyof QueryMethods, args: Partial<IterArgs>); | ||
/** | ||
@@ -28,3 +29,3 @@ * Possibly adds a date into the result. | ||
*/ | ||
accept(date: Date | Partial<IterArgs>): boolean; | ||
accept(date: Date): boolean; | ||
/** | ||
@@ -35,3 +36,3 @@ * | ||
*/ | ||
add(date: Date | Partial<IterArgs>): boolean; | ||
add(date: Date): boolean; | ||
/** | ||
@@ -38,0 +39,0 @@ * 'before' and 'after' return only one date, whereas 'all' |
@@ -8,7 +8,8 @@ "use strict"; | ||
constructor(method, args) { | ||
this.method = method; | ||
this.args = args; | ||
this.minDate = null; | ||
this.maxDate = null; | ||
this._result = []; | ||
this.total = 0; | ||
this.method = method; | ||
this.args = args; | ||
if (method === 'between') { | ||
@@ -36,2 +37,3 @@ this.maxDate = args.inc | ||
accept(date) { | ||
++this.total; | ||
const tooEarly = this.minDate && date < this.minDate; | ||
@@ -38,0 +40,0 @@ const tooLate = this.maxDate && date > this.maxDate; |
@@ -35,5 +35,4 @@ "use strict"; | ||
const bynmonthday = [].concat(this.options.bynmonthday); | ||
bymonthday.sort(); | ||
bynmonthday.sort(); | ||
bynmonthday.reverse(); | ||
bymonthday.sort((a, b) => a - b); | ||
bynmonthday.sort((a, b) => b - a); | ||
// 1, 2, 3, .., -5, -4, -3, .. | ||
@@ -44,3 +43,3 @@ this.bymonthday = bymonthday.concat(bynmonthday); | ||
} | ||
if (this.origOptions.byweekday) { | ||
if (helpers_1.isPresent(this.origOptions.byweekday)) { | ||
const byweekday = !helpers_1.isArray(this.origOptions.byweekday) | ||
@@ -63,3 +62,10 @@ ? [this.origOptions.byweekday] | ||
days.indexOf('SA') === -1 && | ||
days.indexOf('SU') === -1 | ||
days.indexOf('SU') === -1, | ||
isEveryDay: days.indexOf('MO') !== -1 && | ||
days.indexOf('TU') !== -1 && | ||
days.indexOf('WE') !== -1 && | ||
days.indexOf('TH') !== -1 && | ||
days.indexOf('FR') !== -1 && | ||
days.indexOf('SA') !== -1 && | ||
days.indexOf('SU') !== -1 | ||
}; | ||
@@ -187,2 +193,5 @@ const sortWeekDays = function (a, b) { | ||
} | ||
else if (this.byweekday && this.byweekday.isEveryDay) { | ||
this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day')); | ||
} | ||
else { | ||
@@ -189,0 +198,0 @@ if (this.options.interval === 1) |
@@ -63,4 +63,4 @@ "use strict"; | ||
helpers_1.notEmpty(opts.bymonthday) || | ||
opts.byweekday !== null || | ||
opts.byeaster !== null)) { | ||
helpers_1.isPresent(opts.byweekday) || | ||
helpers_1.isPresent(opts.byeaster))) { | ||
switch (opts.freq) { | ||
@@ -67,0 +67,0 @@ case rrule_1.default.YEARLY: |
@@ -1,7 +0,9 @@ | ||
import Weekday from './weekday'; | ||
import dateutil from './dateutil'; | ||
import IterResult from './iterresult'; | ||
import IterResult, { IterArgs } from './iterresult'; | ||
import { Language } from './nlp/i18n'; | ||
import { GetText } from './nlp/totext'; | ||
import { Cache, ParsedOptions, Options, Frequency } from './types'; | ||
import { ParsedOptions, Options, Frequency, QueryMethods } from './types'; | ||
import { parseString } from './parsestring'; | ||
import { optionsToString } from './optionstostring'; | ||
import { Cache, CacheKeys } from './cache'; | ||
export declare const DEFAULT_OPTIONS: Options; | ||
@@ -15,3 +17,3 @@ export declare const defaultKeys: ("bymonthday" | "freq" | "dtstart" | "interval" | "wkst" | "count" | "until" | "bysetpos" | "bymonth" | "bynmonthday" | "byyearday" | "byweekno" | "byweekday" | "bynweekday" | "byhour" | "byminute" | "bysecond" | "byeaster")[]; | ||
*/ | ||
export default class RRule { | ||
export default class RRule implements QueryMethods { | ||
_string: any; | ||
@@ -31,15 +33,17 @@ _cache: Cache | null; | ||
static readonly SECONDLY: Frequency; | ||
static readonly MO: Weekday; | ||
static readonly TU: Weekday; | ||
static readonly WE: Weekday; | ||
static readonly TH: Weekday; | ||
static readonly FR: Weekday; | ||
static readonly SA: Weekday; | ||
static readonly SU: Weekday; | ||
static readonly MO: import("src/weekday").default; | ||
static readonly TU: import("src/weekday").default; | ||
static readonly WE: import("src/weekday").default; | ||
static readonly TH: import("src/weekday").default; | ||
static readonly FR: import("src/weekday").default; | ||
static readonly SA: import("src/weekday").default; | ||
static readonly SU: import("src/weekday").default; | ||
constructor(options?: Partial<Options>, noCache?: boolean); | ||
static parseText(text: string, language: Language): Partial<Options> | null; | ||
static fromText(text: string, language?: Language): RRule; | ||
static parseString(rfcString: string): Partial<Options> | null; | ||
static parseString: typeof parseString; | ||
static fromString(str: string): RRule; | ||
static optionsToString(options: Partial<Options>): string; | ||
static optionsToString: typeof optionsToString; | ||
private _cacheGet; | ||
_cacheAdd(what: CacheKeys | 'all', value: Date[] | Date | null, args?: Partial<IterArgs>): void; | ||
/** | ||
@@ -92,16 +96,2 @@ * @param {Function} iterator - optional function that will be called | ||
/** | ||
* @param {String} what - all/before/after/between | ||
* @param {Array,Date} value - an array of dates, one date, or null | ||
* @param {Object?} args - _iter arguments | ||
*/ | ||
private _cacheAdd; | ||
/** | ||
* @return false - not in the cache | ||
* null - cached, but zero occurrences (before/after) | ||
* Date - cached (before/after) | ||
* [] - cached, but zero occurrences (all/between) | ||
* [Date1, DateN] - cached (all/between) | ||
*/ | ||
private _cacheGet; | ||
/** | ||
* @return a RRule instance with the same freq and options | ||
@@ -112,2 +102,3 @@ * as this one (cache is not cloned) | ||
_iter(iterResult: IterResult): Date | Date[] | null; | ||
private emitResult; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const weekday_1 = require("./weekday"); | ||
const dateutil_1 = require("./dateutil"); | ||
@@ -12,2 +11,4 @@ const iterinfo_1 = require("./iterinfo"); | ||
const parsestring_1 = require("./parsestring"); | ||
const optionstostring_1 = require("./optionstostring"); | ||
const cache_1 = require("./cache"); | ||
const getnlp = function () { | ||
@@ -56,8 +57,3 @@ // Lazy, runtime import to avoid circular refs. | ||
? null | ||
: { | ||
all: false, | ||
before: [], | ||
after: [], | ||
between: [] | ||
}; | ||
: new cache_1.Cache(); | ||
// used by toString() | ||
@@ -75,83 +71,15 @@ this.origOptions = parseoptions_1.initializeOptions(options); | ||
} | ||
static parseString(rfcString) { | ||
return parsestring_1.parseString(rfcString); | ||
} | ||
static fromString(str) { | ||
return new RRule(RRule.parseString(str) || undefined); | ||
} | ||
static optionsToString(options) { | ||
const pairs = []; | ||
const keys = Object.keys(options); | ||
const defaultKeys = Object.keys(exports.DEFAULT_OPTIONS); | ||
for (let i = 0; i < keys.length; i++) { | ||
if (!helpers_1.includes(defaultKeys, keys[i])) | ||
continue; | ||
let key = keys[i].toUpperCase(); | ||
let value = options[keys[i]]; | ||
let strValues = []; | ||
if (!helpers_1.isPresent(value) || (helpers_1.isArray(value) && !value.length)) | ||
continue; | ||
switch (key) { | ||
case 'FREQ': | ||
value = RRule.FREQUENCIES[options.freq]; | ||
break; | ||
case 'WKST': | ||
if (helpers_1.isNumber(value)) { | ||
value = new weekday_1.default(value); | ||
} | ||
break; | ||
case 'BYWEEKDAY': | ||
/* | ||
NOTE: BYWEEKDAY is a special case. | ||
RRule() deconstructs the rule.options.byweekday array | ||
into an array of Weekday arguments. | ||
On the other hand, rule.origOptions is an array of Weekdays. | ||
We need to handle both cases here. | ||
It might be worth change RRule to keep the Weekdays. | ||
Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC) | ||
*/ | ||
key = 'BYDAY'; | ||
if (!helpers_1.isArray(value)) | ||
value = [value]; | ||
for (let j = 0; j < value.length; j++) { | ||
let wday = value[j]; | ||
if (wday instanceof weekday_1.default) { | ||
// good | ||
} | ||
else if (helpers_1.isArray(wday)) { | ||
wday = new weekday_1.default(wday[0], wday[1]); | ||
} | ||
else { | ||
wday = new weekday_1.default(wday); | ||
} | ||
strValues[j] = wday.toString(); | ||
} | ||
value = strValues; | ||
break; | ||
case 'DTSTART': | ||
case 'UNTIL': | ||
value = dateutil_1.default.timeToUntilString(value); | ||
break; | ||
default: | ||
if (helpers_1.isArray(value)) { | ||
for (let j = 0; j < value.length; j++) { | ||
strValues[j] = String(value[j]); | ||
} | ||
value = strValues; | ||
} | ||
else { | ||
value = String(value); | ||
} | ||
} | ||
pairs.push([key, value]); | ||
} | ||
const strings = []; | ||
for (let i = 0; i < pairs.length; i++) { | ||
const attr = pairs[i]; | ||
strings.push(attr[0] + '=' + attr[1].toString()); | ||
} | ||
return strings.join(';'); | ||
_cacheGet(what, args) { | ||
if (!this._cache) | ||
return false; | ||
return this._cache._cacheGet(what, args); | ||
} | ||
_cacheAdd(what, value, args) { | ||
if (!this._cache) | ||
return; | ||
return this._cache._cacheAdd(what, value, args); | ||
} | ||
/** | ||
@@ -242,3 +170,3 @@ * @param {Function} iterator - optional function that will be called | ||
toString() { | ||
return RRule.optionsToString(this.origOptions); | ||
return optionstostring_1.optionsToString(this.origOptions); | ||
} | ||
@@ -256,77 +184,2 @@ /** | ||
/** | ||
* @param {String} what - all/before/after/between | ||
* @param {Array,Date} value - an array of dates, one date, or null | ||
* @param {Object?} args - _iter arguments | ||
*/ | ||
_cacheAdd(what, value, args) { | ||
if (!this._cache) | ||
return; | ||
if (value) { | ||
value = | ||
value instanceof Date | ||
? dateutil_1.default.clone(value) | ||
: dateutil_1.default.cloneDates(value); | ||
} | ||
if (what === 'all') { | ||
this._cache.all = value; | ||
} | ||
else { | ||
args._value = value; | ||
this._cache[what].push(args); | ||
} | ||
} | ||
/** | ||
* @return false - not in the cache | ||
* null - cached, but zero occurrences (before/after) | ||
* Date - cached (before/after) | ||
* [] - cached, but zero occurrences (all/between) | ||
* [Date1, DateN] - cached (all/between) | ||
*/ | ||
_cacheGet(what, args) { | ||
if (!this._cache) | ||
return false; | ||
let cached = false; | ||
const argsKeys = args ? Object.keys(args) : []; | ||
const findCacheDiff = function (item) { | ||
for (let i = 0; i < argsKeys.length; i++) { | ||
const key = argsKeys[i]; | ||
if (String(args[key]) !== String(item[key])) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
const cachedObject = this._cache[what]; | ||
if (what === 'all') { | ||
cached = this._cache.all; | ||
} | ||
else if (helpers_1.isArray(cachedObject)) { | ||
// Let's see whether we've already called the | ||
// 'what' method with the same 'args' | ||
for (let i = 0; i < cachedObject.length; i++) { | ||
const item = cachedObject[i]; | ||
if (argsKeys.length && findCacheDiff(item)) | ||
continue; | ||
cached = item._value; | ||
break; | ||
} | ||
} | ||
if (!cached && this._cache.all) { | ||
// Not in the cache, but we already know all the occurrences, | ||
// so we can find the correct dates from the cached ones. | ||
const iterResult = new iterresult_1.default(what, args); | ||
for (let i = 0; i < this._cache.all.length; i++) { | ||
if (!iterResult.accept(this._cache.all[i])) | ||
break; | ||
} | ||
cached = iterResult.getValue(); | ||
this._cacheAdd(what, cached, args); | ||
} | ||
return helpers_1.isArray(cached) | ||
? dateutil_1.default.cloneDates(cached) | ||
: cached instanceof Date | ||
? dateutil_1.default.clone(cached) | ||
: cached; | ||
} | ||
/** | ||
* @return a RRule instance with the same freq and options | ||
@@ -344,14 +197,7 @@ * as this one (cache is not cloned) | ||
const dtstart = this.options.dtstart; | ||
const dtstartMillisecondModulo = this.options.dtstart.valueOf() % 1000; | ||
let year = dtstart.getUTCFullYear(); | ||
let month = dtstart.getUTCMonth() + 1; | ||
let day = dtstart.getUTCDate(); | ||
let hour = dtstart.getUTCHours(); | ||
let minute = dtstart.getUTCMinutes(); | ||
let second = dtstart.getUTCSeconds(); | ||
let weekday = dateutil_1.default.getWeekday(dtstart); | ||
let date = new dateutil_1.default.DateTime(dtstart.getUTCFullYear(), dtstart.getUTCMonth() + 1, dtstart.getUTCDate(), dtstart.getUTCHours(), dtstart.getUTCMinutes(), dtstart.getUTCSeconds(), dtstart.valueOf() % 1000); | ||
// Some local variables to speed things up a bit | ||
const { freq, interval, wkst, until, bymonth, byweekno, byyearday, byweekday, byeaster, bymonthday, bynmonthday, bysetpos, byhour, byminute, bysecond } = this.options; | ||
const ii = new iterinfo_1.default(this); | ||
ii.rebuild(year, month); | ||
ii.rebuild(date.year, date.month); | ||
const getdayset = { | ||
@@ -377,25 +223,21 @@ [RRule.YEARLY]: ii.ydayset, | ||
}[freq]; | ||
if ((freq >= RRule.HOURLY && helpers_1.notEmpty(byhour) && !helpers_1.includes(byhour, hour)) || | ||
if ((freq >= RRule.HOURLY && helpers_1.notEmpty(byhour) && !helpers_1.includes(byhour, date.hour)) || | ||
(freq >= RRule.MINUTELY && | ||
helpers_1.notEmpty(byminute) && | ||
!helpers_1.includes(byminute, minute)) || | ||
!helpers_1.includes(byminute, date.minute)) || | ||
(freq >= RRule.SECONDLY && | ||
helpers_1.notEmpty(bysecond) && | ||
!helpers_1.includes(bysecond, second))) { | ||
!helpers_1.includes(bysecond, date.second))) { | ||
timeset = []; | ||
} | ||
else { | ||
timeset = gettimeset.call(ii, hour, minute, second, dtstartMillisecondModulo); | ||
timeset = gettimeset.call(ii, date.hour, date.minute, date.second, date.millisecond); | ||
} | ||
} | ||
let currentDay; | ||
let total = 0; | ||
let count = this.options.count; | ||
let dm; | ||
let div; | ||
let mod; | ||
let pos; | ||
while (true) { | ||
// Get dayset with the right frequency | ||
const [dayset, start, end] = getdayset.call(ii, year, month, day); | ||
const [dayset, start, end] = getdayset.call(ii, date.year, date.month, date.day); | ||
// Do the "hard" work ;-) | ||
@@ -424,28 +266,24 @@ let filtered = false; | ||
} | ||
try { | ||
const tmp = []; | ||
for (let k = start; k < end; k++) { | ||
const val = dayset[k]; | ||
if (!helpers_1.isPresent(val)) | ||
continue; | ||
tmp.push(val); | ||
} | ||
let i; | ||
if (daypos < 0) { | ||
// we're trying to emulate python's aList[-n] | ||
i = tmp.slice(daypos)[0]; | ||
} | ||
else { | ||
i = tmp[daypos]; | ||
} | ||
const time = timeset[timepos]; | ||
const date = dateutil_1.default.fromOrdinal(ii.yearordinal + i); | ||
const res = dateutil_1.default.combine(date, time); | ||
// XXX: can this ever be in the array? | ||
// - compare the actual date instead? | ||
if (!helpers_1.includes(poslist, res)) | ||
poslist.push(res); | ||
// tslint:disable-next-line:no-empty | ||
const tmp = []; | ||
for (let k = start; k < end; k++) { | ||
const val = dayset[k]; | ||
if (!helpers_1.isPresent(val)) | ||
continue; | ||
tmp.push(val); | ||
} | ||
catch (e) { } | ||
let i; | ||
if (daypos < 0) { | ||
// we're trying to emulate python's aList[-n] | ||
i = tmp.slice(daypos)[0]; | ||
} | ||
else { | ||
i = tmp[daypos]; | ||
} | ||
const time = timeset[timepos]; | ||
const date = dateutil_1.default.fromOrdinal(ii.yearordinal + i); | ||
const res = dateutil_1.default.combine(date, time); | ||
// XXX: can this ever be in the array? | ||
// - compare the actual date instead? | ||
if (!helpers_1.includes(poslist, res)) | ||
poslist.push(res); | ||
} | ||
@@ -456,9 +294,7 @@ dateutil_1.default.sort(poslist); | ||
if (until && res > until) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
return this.emitResult(iterResult); | ||
} | ||
else if (res >= dtstart) { | ||
++total; | ||
if (res >= dtstart) { | ||
if (!iterResult.accept(res)) { | ||
return iterResult.getValue(); | ||
return this.emitResult(iterResult); | ||
} | ||
@@ -468,4 +304,3 @@ if (count) { | ||
if (!count) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
return this.emitResult(iterResult); | ||
} | ||
@@ -479,23 +314,21 @@ } | ||
currentDay = dayset[j]; | ||
if (currentDay !== null) { | ||
const date = dateutil_1.default.fromOrdinal(ii.yearordinal + currentDay); | ||
for (let k = 0; k < timeset.length; k++) { | ||
const time = timeset[k]; | ||
const res = dateutil_1.default.combine(date, time); | ||
if (until && res > until) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
if (!helpers_1.isPresent(currentDay)) { | ||
continue; | ||
} | ||
const date = dateutil_1.default.fromOrdinal(ii.yearordinal + currentDay); | ||
for (let k = 0; k < timeset.length; k++) { | ||
const time = timeset[k]; | ||
const res = dateutil_1.default.combine(date, time); | ||
if (until && res > until) { | ||
return this.emitResult(iterResult); | ||
} | ||
if (res >= dtstart) { | ||
if (!iterResult.accept(res)) { | ||
return this.emitResult(iterResult); | ||
} | ||
else if (res >= dtstart) { | ||
++total; | ||
if (!iterResult.accept(res)) { | ||
return iterResult.getValue(); | ||
if (count) { | ||
--count; | ||
if (!count) { | ||
return this.emitResult(iterResult); | ||
} | ||
if (count) { | ||
--count; | ||
if (!count) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
} | ||
} | ||
} | ||
@@ -507,156 +340,43 @@ } | ||
// Handle frequency and interval | ||
let fixday = false; | ||
if (freq === RRule.YEARLY) { | ||
year += interval; | ||
if (year > dateutil_1.default.MAXYEAR) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
} | ||
ii.rebuild(year, month); | ||
date.addYears(interval); | ||
} | ||
else if (freq === RRule.MONTHLY) { | ||
month += interval; | ||
if (month > 12) { | ||
div = Math.floor(month / 12); | ||
mod = helpers_1.pymod(month, 12); | ||
month = mod; | ||
year += div; | ||
if (month === 0) { | ||
month = 12; | ||
--year; | ||
} | ||
if (year > dateutil_1.default.MAXYEAR) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
} | ||
} | ||
ii.rebuild(year, month); | ||
date.addMonths(interval); | ||
} | ||
else if (freq === RRule.WEEKLY) { | ||
if (wkst > weekday) { | ||
day += -(weekday + 1 + (6 - wkst)) + interval * 7; | ||
} | ||
else { | ||
day += -(weekday - wkst) + interval * 7; | ||
} | ||
weekday = wkst; | ||
fixday = true; | ||
date.addWeekly(interval, wkst); | ||
} | ||
else if (freq === RRule.DAILY) { | ||
day += interval; | ||
fixday = true; | ||
date.addDaily(interval); | ||
} | ||
else if (freq === RRule.HOURLY) { | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
hour += Math.floor((23 - hour) / interval) * interval; | ||
} | ||
while (true) { | ||
hour += interval; | ||
dm = helpers_1.divmod(hour, 24); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
hour = mod; | ||
day += div; | ||
fixday = true; | ||
} | ||
if (helpers_1.empty(byhour) || helpers_1.includes(byhour, hour)) | ||
break; | ||
} | ||
date.addHours(interval, filtered, byhour); | ||
// @ts-ignore | ||
timeset = gettimeset.call(ii, hour, minute, second); | ||
timeset = gettimeset.call(ii, date.hour, date.minute, date.second); | ||
} | ||
else if (freq === RRule.MINUTELY) { | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
minute += | ||
Math.floor((1439 - (hour * 60 + minute)) / interval) * interval; | ||
if (date.addMinutes(interval, filtered, byhour, byminute)) { | ||
filtered = false; | ||
} | ||
while (true) { | ||
minute += interval; | ||
dm = helpers_1.divmod(minute, 60); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
minute = mod; | ||
hour += div; | ||
dm = helpers_1.divmod(hour, 24); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
hour = mod; | ||
day += div; | ||
fixday = true; | ||
filtered = false; | ||
} | ||
} | ||
if ((helpers_1.empty(byhour) || helpers_1.includes(byhour, hour)) && | ||
(helpers_1.empty(byminute) || helpers_1.includes(byminute, minute))) { | ||
break; | ||
} | ||
} | ||
// @ts-ignore | ||
timeset = gettimeset.call(ii, hour, minute, second); | ||
timeset = gettimeset.call(ii, date.hour, date.minute, date.second); | ||
} | ||
else if (freq === RRule.SECONDLY) { | ||
if (filtered) { | ||
// Jump to one iteration before next day | ||
second += | ||
Math.floor((86399 - (hour * 3600 + minute * 60 + second)) / interval) * interval; | ||
if (date.addSeconds(interval, filtered, byhour, byminute, bysecond)) { | ||
filtered = false; | ||
} | ||
while (true) { | ||
second += interval; | ||
dm = helpers_1.divmod(second, 60); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
second = mod; | ||
minute += div; | ||
dm = helpers_1.divmod(minute, 60); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
minute = mod; | ||
hour += div; | ||
dm = helpers_1.divmod(hour, 24); | ||
div = dm.div; | ||
mod = dm.mod; | ||
if (div) { | ||
hour = mod; | ||
day += div; | ||
fixday = true; | ||
} | ||
} | ||
} | ||
if ((helpers_1.empty(byhour) || helpers_1.includes(byhour, hour)) && | ||
(helpers_1.empty(byminute) || helpers_1.includes(byminute, minute)) && | ||
(helpers_1.empty(bysecond) || helpers_1.includes(bysecond, second))) { | ||
break; | ||
} | ||
} | ||
// @ts-ignore | ||
timeset = gettimeset.call(ii, hour, minute, second); | ||
timeset = gettimeset.call(ii, date.hour, date.minute, date.second); | ||
} | ||
if (fixday && day > 28) { | ||
let daysinmonth = dateutil_1.default.monthRange(year, month - 1)[1]; | ||
if (day > daysinmonth) { | ||
while (day > daysinmonth) { | ||
day -= daysinmonth; | ||
++month; | ||
if (month === 13) { | ||
month = 1; | ||
++year; | ||
if (year > dateutil_1.default.MAXYEAR) { | ||
this._len = total; | ||
return iterResult.getValue(); | ||
} | ||
} | ||
daysinmonth = dateutil_1.default.monthRange(year, month - 1)[1]; | ||
} | ||
ii.rebuild(year, month); | ||
} | ||
if (date.year > dateutil_1.default.MAXYEAR) { | ||
return this.emitResult(iterResult); | ||
} | ||
ii.rebuild(date.year, date.month); | ||
} | ||
} | ||
emitResult(iterResult) { | ||
this._len = iterResult.total; | ||
return iterResult.getValue(); | ||
} | ||
} | ||
@@ -687,2 +407,4 @@ // RRule class 'constants' | ||
RRule.SU = types_1.Days.SU; | ||
RRule.parseString = parsestring_1.parseString; | ||
RRule.optionsToString = optionstostring_1.optionsToString; | ||
exports.default = RRule; | ||
@@ -689,0 +411,0 @@ function isFiltered(bymonth, ii, currentDay, byweekno, byweekday, byeaster, bymonthday, bynmonthday, byyearday) { |
import Weekday from './weekday'; | ||
import { IterArgs } from './iterresult'; | ||
export interface QueryMethods { | ||
all(): Date[]; | ||
between(after: Date, before: Date, inc: boolean): Date[]; | ||
before(date: Date, inc: boolean): Date; | ||
after(date: Date, inc: boolean): Date; | ||
} | ||
export declare enum Frequency { | ||
@@ -46,9 +51,2 @@ YEARLY = 0, | ||
} | ||
export declare type CacheKeys = 'before' | 'after' | 'between'; | ||
declare type CacheBase = { | ||
[K in CacheKeys]: IterArgs[]; | ||
}; | ||
export declare type Cache = CacheBase & { | ||
all: Date[] | Partial<IterArgs>[] | false; | ||
}; | ||
export declare const Days: { | ||
@@ -65,2 +63,1 @@ MO: Weekday; | ||
export declare type ByWeekday = WeekdayStr | number | Weekday; | ||
export {}; |
{ | ||
"name": "rrule", | ||
"version": "2.3.4", | ||
"version": "2.3.5", | ||
"description": "JavaScript library for working with recurrence rules for calendar dates.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://jakubroztocil.github.io/rrule/", |
@@ -234,3 +234,3 @@ rrule.js | ||
<td><code>bysetpos</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, positive or negative. Each given integer will specify | ||
@@ -248,3 +248,3 @@ an occurrence number, corresponding to the nth occurrence of | ||
<td><code>bymonth</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the months to apply the recurrence to. | ||
@@ -255,3 +255,3 @@ </td> | ||
<td><code>bymonthday</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the month days to apply the recurrence to. | ||
@@ -262,3 +262,3 @@ </td> | ||
<td><code>byyearday</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the year days to apply the recurrence to. | ||
@@ -269,3 +269,3 @@ </td> | ||
<td><code>byweekno</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the week numbers to apply the recurrence to. | ||
@@ -279,6 +279,6 @@ Week numbers have the meaning described in ISO8601, that is, | ||
<td><code>byweekday</code></td> | ||
<td>If given, it must be either an integer (<code>0 == RRule.MO</code>), a | ||
sequence of integers, one of the weekday constants | ||
<td>If given, it must be either an integer (<code>0 == RRule.MO</code>), an | ||
array of integers, one of the weekday constants | ||
(<code>RRule.MO</code>, | ||
<code>RRule.TU</code>, etc), or a sequence of these constants. When | ||
<code>RRule.TU</code>, etc), or an array of these constants. When | ||
given, | ||
@@ -301,3 +301,3 @@ these variables will define the weekdays where the recurrence | ||
<td><code>byhour</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the hours to apply the recurrence to. | ||
@@ -308,3 +308,3 @@ </td> | ||
<td><code>byminute</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the minutes to apply the recurrence to. | ||
@@ -315,3 +315,3 @@ </td> | ||
<td><code>bysecond</code></td> | ||
<td>If given, it must be either an integer, or a sequence of | ||
<td>If given, it must be either an integer, or an array of | ||
integers, meaning the seconds to apply the recurrence to. | ||
@@ -318,0 +318,0 @@ </td> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1278178
71
8263