diff --git a/build/ouical.js b/build/ouical.js index 843aa08..892b16b 100644 --- a/build/ouical.js +++ b/build/ouical.js @@ -2525,7 +2525,7 @@ Ouical = (function() { }; googleGenerator = function() { - return encodeURI("https://www.google.com/calendar/render" + "?action=TEMPLATE" + ("&text=" + this.title) + ("&dates=" + (this.start.format('YYYYMMDDTHHmmss')) + "Z/" + (this.end.format('YYYYMMDDTHHmmss')) + "Z") + ("&details=" + this.description) + ("&location=" + this.address) + "&sprop=&sprop=name:"); + return encodeURI("https://www.google.com/calendar/render" + "?action=TEMPLATE" + ("&text=" + this.title) + ("&dates=" + (this.start.format('YYYYMMDDTHHmmss')) + "Z/") + ("" + (this.end.format('YYYYMMDDTHHmmss')) + "Z") + ("&details=" + this.description) + ("&location=" + this.address) + "&sprop=&sprop=name:"); }; yahooGenerator = function() { diff --git a/build/ouical.min.js b/build/ouical.min.js index 41f36e9..b06e837 100644 --- a/build/ouical.min.js +++ b/build/ouical.min.js @@ -3,7 +3,7 @@ (function(e){function t(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function n(e,t){function n(){ut.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}var r=!0;return u(function(){return r&&(n(),r=!1),t.apply(this,arguments)},t)}function r(e,t){return function(n){return f(e.call(this,n),t)}}function s(e,t){return function(n){return this.lang().ordinal(e.call(this,n),t)}}function a(){}function i(e){v(e),u(this,e)}function o(e){var t=p(e),n=t.year||0,r=t.quarter||0,s=t.month||0,a=t.week||0,i=t.day||0,o=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._milliseconds=+d+1e3*c+6e4*u+36e5*o,this._days=+i+7*a,this._months=+s+3*r+12*n,this._data={},this._bubble()}function u(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return t.hasOwnProperty("toString")&&(e.toString=t.toString),t.hasOwnProperty("valueOf")&&(e.valueOf=t.valueOf),e}function c(e){var t,n={};for(t in e)e.hasOwnProperty(t)&&Dt.hasOwnProperty(t)&&(n[t]=e[t]);return n}function d(e){return 0>e?Math.ceil(e):Math.floor(e)}function f(e,t,n){for(var r=""+Math.abs(e),s=e>=0;r.lengthr;r++)(n&&e[r]!==t[r]||!n&&Y(e[r])!==Y(t[r]))&&i++;return i+a}function y(e){if(e){var t=e.toLowerCase().replace(/(.)s$/,"$1");e=Rt[e]||Bt[t]||t}return e}function p(e){var t,n,r={};for(n in e)e.hasOwnProperty(n)&&(t=y(n),t&&(r[t]=e[n]));return r}function g(t){var n,r;if(0===t.indexOf("week"))n=7,r="day";else{if(0!==t.indexOf("month"))return;n=12,r="month"}ut[t]=function(s,a){var i,o,u=ut.fn._lang[t],c=[];if("number"==typeof s&&(a=s,s=e),o=function(e){var t=ut().utc().set(r,e);return u.call(ut.fn._lang,t,s||"")},null!=a)return o(a);for(i=0;n>i;i++)c.push(o(i));return c}}function Y(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=t>=0?Math.floor(t):Math.ceil(t)),n}function w(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function M(e,t,n){return B(ut([e,11,31+t-n]),t,n).week}function D(e){return k(e)?366:365}function k(e){return e%4===0&&e%100!==0||e%400===0}function v(e){var t;e._a&&-2===e._pf.overflow&&(t=e._a[mt]<0||e._a[mt]>11?mt:e._a[yt]<1||e._a[yt]>w(e._a[_t],e._a[mt])?yt:e._a[pt]<0||e._a[pt]>23?pt:e._a[gt]<0||e._a[gt]>59?gt:e._a[Yt]<0||e._a[Yt]>59?Yt:e._a[wt]<0||e._a[wt]>999?wt:-1,e._pf._overflowDayOfYear&&(_t>t||t>yt)&&(t=yt),e._pf.overflow=t)}function b(e){return null==e._isValid&&(e._isValid=!isNaN(e._d.getTime())&&e._pf.overflow<0&&!e._pf.empty&&!e._pf.invalidMonth&&!e._pf.nullInput&&!e._pf.invalidFormat&&!e._pf.userInvalidated,e._strict&&(e._isValid=e._isValid&&0===e._pf.charsLeftOver&&0===e._pf.unusedTokens.length)),e._isValid}function S(e){return e?e.toLowerCase().replace("_","-"):e}function T(e,t){return t._isUTC?ut(e).zone(t._offset||0):ut(e).local()}function O(e,t){return t.abbr=e,Mt[e]||(Mt[e]=new a),Mt[e].set(t),Mt[e]}function W(e){delete Mt[e]}function G(e){var t,n,r,s,a=0,i=function(e){if(!Mt[e]&&kt)try{_dereq_("./lang/"+e)}catch(t){}return Mt[e]};if(!e)return ut.fn._lang;if(!l(e)){if(n=i(e))return n;e=[e]}for(;a0;){if(n=i(s.slice(0,t).join("-")))return n;if(r&&r.length>=t&&m(s,r,!0)>=t-1)break;t--}a++}return ut.fn._lang}function F(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function C(e){var t,n,r=e.match(Tt);for(t=0,n=r.length;n>t;t++)r[t]=nn[r[t]]?nn[r[t]]:F(r[t]);return function(s){var a="";for(t=0;n>t;t++)a+=r[t]instanceof Function?r[t].call(s,e):r[t];return a}}function P(e,t){return e.isValid()?(t=U(t,e.lang()),Kt[t]||(Kt[t]=C(t)),Kt[t](e)):e.lang().invalidDate()}function U(e,t){function n(e){return t.longDateFormat(e)||e}var r=5;for(Ot.lastIndex=0;r>=0&&Ot.test(e);)e=e.replace(Ot,n),Ot.lastIndex=0,r-=1;return e}function z(e,t){var n,r=t._strict;switch(e){case"Q":return At;case"DDDD":return Zt;case"YYYY":case"GGGG":case"gggg":return r?Et:Ft;case"Y":case"G":case"g":return Nt;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return r?jt:Ct;case"S":if(r)return At;case"SS":if(r)return xt;case"SSS":if(r)return Zt;case"DDD":return Gt;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ut;case"a":case"A":return G(t._l)._meridiemParse;case"X":return Ht;case"Z":case"ZZ":return zt;case"T":return Lt;case"SSSS":return Pt;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return r?xt:Wt;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Wt;case"Do":return It;default:return n=new RegExp(j(E(e.replace("\\","")),"i"))}}function L(e){e=e||"";var t=e.match(zt)||[],n=t[t.length-1]||[],r=(n+"").match(Qt)||["-",0,0],s=+(60*r[1])+Y(r[2]);return"+"===r[0]?-s:s}function H(e,t,n){var r,s=n._a;switch(e){case"Q":null!=t&&(s[mt]=3*(Y(t)-1));break;case"M":case"MM":null!=t&&(s[mt]=Y(t)-1);break;case"MMM":case"MMMM":r=G(n._l).monthsParse(t),null!=r?s[mt]=r:n._pf.invalidMonth=t;break;case"D":case"DD":null!=t&&(s[yt]=Y(t));break;case"Do":null!=t&&(s[yt]=Y(parseInt(t,10)));break;case"DDD":case"DDDD":null!=t&&(n._dayOfYear=Y(t));break;case"YY":s[_t]=ut.parseTwoDigitYear(t);break;case"YYYY":case"YYYYY":case"YYYYYY":s[_t]=Y(t);break;case"a":case"A":n._isPm=G(n._l).isPM(t);break;case"H":case"HH":case"h":case"hh":s[pt]=Y(t);break;case"m":case"mm":s[gt]=Y(t);break;case"s":case"ss":s[Yt]=Y(t);break;case"S":case"SS":case"SSS":case"SSSS":s[wt]=Y(1e3*("0."+t));break;case"X":n._d=new Date(1e3*parseFloat(t));break;case"Z":case"ZZ":n._useUTC=!0,n._tzm=L(t);break;case"w":case"ww":case"W":case"WW":case"d":case"dd":case"ddd":case"dddd":case"e":case"E":e=e.substr(0,1);case"gg":case"gggg":case"GG":case"GGGG":case"GGGGG":e=e.substr(0,2),t&&(n._w=n._w||{},n._w[e]=t)}}function I(e){var t,n,r,s,a,i,o,u,c,d,f=[];if(!e._d){for(r=x(e),e._w&&null==e._a[yt]&&null==e._a[mt]&&(a=function(t){var n=parseInt(t,10);return t?t.length<3?n>68?1900+n:2e3+n:n:null==e._a[_t]?ut().weekYear():e._a[_t]},i=e._w,null!=i.GG||null!=i.W||null!=i.E?o=K(a(i.GG),i.W||1,i.E,4,1):(u=G(e._l),c=null!=i.d?Q(i.d,u):null!=i.e?parseInt(i.e,10)+u._week.dow:0,d=parseInt(i.w,10)||1,null!=i.d&&cD(s)&&(e._pf._overflowDayOfYear=!0),n=J(s,0,e._dayOfYear),e._a[mt]=n.getUTCMonth(),e._a[yt]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=f[t]=r[t];for(;7>t;t++)e._a[t]=f[t]=null==e._a[t]?2===t?1:0:e._a[t];f[pt]+=Y((e._tzm||0)/60),f[gt]+=Y((e._tzm||0)%60),e._d=(e._useUTC?J:$).apply(null,f)}}function A(e){var t;e._d||(t=p(e._i),e._a=[t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond],I(e))}function x(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Z(e){e._a=[],e._pf.empty=!0;var t,n,r,s,a,i=G(e._l),o=""+e._i,u=o.length,c=0;for(r=U(e._f,i).match(Tt)||[],t=0;t0&&e._pf.unusedInput.push(a),o=o.slice(o.indexOf(n)+n.length),c+=n.length),nn[s]?(n?e._pf.empty=!1:e._pf.unusedTokens.push(s),H(s,n,e)):e._strict&&!n&&e._pf.unusedTokens.push(s);e._pf.charsLeftOver=u-c,o.length>0&&e._pf.unusedInput.push(o),e._isPm&&e._a[pt]<12&&(e._a[pt]+=12),e._isPm===!1&&12===e._a[pt]&&(e._a[pt]=0),I(e),v(e)}function E(e){return e.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,s){return t||n||r||s})}function j(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function N(e){var n,r,s,a,i;if(0===e._f.length)return e._pf.invalidFormat=!0,void(e._d=new Date(0/0));for(a=0;ai)&&(s=i,r=n));u(e,r||n)}function q(e){var t,n,r=e._i,s=qt.exec(r);if(s){for(e._pf.iso=!0,t=0,n=$t.length;n>t;t++)if($t[t][1].exec(r)){e._f=$t[t][0]+(s[6]||" ");break}for(t=0,n=Jt.length;n>t;t++)if(Jt[t][1].exec(r)){e._f+=Jt[t][0];break}r.match(zt)&&(e._f+="Z"),Z(e)}else ut.createFromInputFallback(e)}function V(t){var n=t._i,r=vt.exec(n);n===e?t._d=new Date:r?t._d=new Date(+r[1]):"string"==typeof n?q(t):l(n)?(t._a=n.slice(0),I(t)):_(n)?t._d=new Date(+n):"object"==typeof n?A(t):"number"==typeof n?t._d=new Date(n):ut.createFromInputFallback(t)}function $(e,t,n,r,s,a,i){var o=new Date(e,t,n,r,s,a,i);return 1970>e&&o.setFullYear(e),o}function J(e){var t=new Date(Date.UTC.apply(null,arguments));return 1970>e&&t.setUTCFullYear(e),t}function Q(e,t){if("string"==typeof e)if(isNaN(e)){if(e=t.weekdaysParse(e),"number"!=typeof e)return null}else e=parseInt(e,10);return e}function X(e,t,n,r,s){return s.relativeTime(t||1,!!n,e,r)}function R(e,t,n){var r=lt(Math.abs(e)/1e3),s=lt(r/60),a=lt(s/60),i=lt(a/24),o=lt(i/365),u=45>r&&["s",r]||1===s&&["m"]||45>s&&["mm",s]||1===a&&["h"]||22>a&&["hh",a]||1===i&&["d"]||25>=i&&["dd",i]||45>=i&&["M"]||345>i&&["MM",lt(i/30)]||1===o&&["y"]||["yy",o];return u[2]=t,u[3]=e>0,u[4]=n,X.apply({},u)}function B(e,t,n){var r,s=n-t,a=n-e.day();return a>s&&(a-=7),s-7>a&&(a+=7),r=ut(e).add("d",a),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function K(e,t,n,r,s){var a,i,o=J(e,0,1).getUTCDay();return n=null!=n?n:s,a=s-o+(o>r?7:0)-(s>o?7:0),i=7*(t-1)+(n-s)+a+1,{year:i>0?e:e-1,dayOfYear:i>0?i:D(e-1)+i}}function et(t){var n=t._i,r=t._f;return null===n||r===e&&""===n?ut.invalid({nullInput:!0}):("string"==typeof n&&(t._i=n=G().preparse(n)),ut.isMoment(n)?(t=c(n),t._d=new Date(+n._d)):r?l(r)?N(t):Z(t):V(t),new i(t))}function tt(e,t){var n;return"string"==typeof t&&(t=e.lang().monthsParse(t),"number"!=typeof t)?e:(n=Math.min(e.date(),w(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e)}function nt(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function rt(e,t,n){return"Month"===t?tt(e,n):e._d["set"+(e._isUTC?"UTC":"")+t](n)}function st(e,t){return function(n){return null!=n?(rt(this,e,n),ut.updateOffset(this,t),this):nt(this,e)}}function at(e){ut.duration.fn[e]=function(){return this._data[e]}}function it(e,t){ut.duration.fn["as"+e]=function(){return+this/t}}function ot(e){"undefined"==typeof ender&&(ct=ht.moment,ht.moment=e?n("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",ut):ut)}for(var ut,ct,dt,ft="2.6.0",ht="undefined"!=typeof global?global:this,lt=Math.round,_t=0,mt=1,yt=2,pt=3,gt=4,Yt=5,wt=6,Mt={},Dt={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},kt="undefined"!=typeof module&&module.exports,vt=/^\/?Date\((\-?\d+)/i,bt=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,St=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Tt=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,Ot=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Wt=/\d\d?/,Gt=/\d{1,3}/,Ft=/\d{1,4}/,Ct=/[+\-]?\d{1,6}/,Pt=/\d+/,Ut=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,zt=/Z|[\+\-]\d\d:?\d\d/gi,Lt=/T/i,Ht=/[\+\-]?\d+(\.\d{1,3})?/,It=/\d{1,2}/,At=/\d/,xt=/\d\d/,Zt=/\d{3}/,Et=/\d{4}/,jt=/[+-]?\d{6}/,Nt=/[+-]?\d+/,qt=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vt="YYYY-MM-DDTHH:mm:ssZ",$t=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Jt=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Qt=/([\+\-]|\d\d)/gi,Xt=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),Rt={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},Bt={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},Kt={},en="DDD w W M D d".split(" "),tn="M D H h m s w W".split(" "),nn={M:function(){return this.month()+1},MMM:function(e){return this.lang().monthsShort(this,e)},MMMM:function(e){return this.lang().months(this,e)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(e){return this.lang().weekdaysMin(this,e)},ddd:function(e){return this.lang().weekdaysShort(this,e)},dddd:function(e){return this.lang().weekdays(this,e)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return f(this.year()%100,2)},YYYY:function(){return f(this.year(),4)},YYYYY:function(){return f(this.year(),5)},YYYYYY:function(){var e=this.year(),t=e>=0?"+":"-";return t+f(Math.abs(e),6)},gg:function(){return f(this.weekYear()%100,2)},gggg:function(){return f(this.weekYear(),4)},ggggg:function(){return f(this.weekYear(),5)},GG:function(){return f(this.isoWeekYear()%100,2)},GGGG:function(){return f(this.isoWeekYear(),4)},GGGGG:function(){return f(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return Y(this.milliseconds()/100)},SS:function(){return f(Y(this.milliseconds()/10),2)},SSS:function(){return f(this.milliseconds(),3)},SSSS:function(){return f(this.milliseconds(),3)},Z:function(){var e=-this.zone(),t="+";return 0>e&&(e=-e,t="-"),t+f(Y(e/60),2)+":"+f(Y(e)%60,2)},ZZ:function(){var e=-this.zone(),t="+";return 0>e&&(e=-e,t="-"),t+f(Y(e/60),2)+f(Y(e)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},rn=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];en.length;)dt=en.pop(),nn[dt+"o"]=s(nn[dt],dt);for(;tn.length;)dt=tn.pop(),nn[dt+dt]=r(nn[dt],2);for(nn.DDDD=r(nn.DDD,3),u(a.prototype,{set:function(e){var t,n;for(n in e)t=e[n],"function"==typeof t?this[n]=t:this["_"+n]=t},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(e){return this._months[e.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(e){return this._monthsShort[e.month()]},monthsParse:function(e){var t,n,r;for(this._monthsParse||(this._monthsParse=[]),t=0;12>t;t++)if(this._monthsParse[t]||(n=ut.utc([2e3,t]),r="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[t]=new RegExp(r.replace(".",""),"i")),this._monthsParse[t].test(e))return t},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(e){return this._weekdays[e.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(e){return this._weekdaysShort[e.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(e){return this._weekdaysMin[e.day()]},weekdaysParse:function(e){var t,n,r;for(this._weekdaysParse||(this._weekdaysParse=[]),t=0;7>t;t++)if(this._weekdaysParse[t]||(n=ut([2e3,1]).day(t),r="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(r.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(e){var t=this._longDateFormat[e];return!t&&this._longDateFormat[e.toUpperCase()]&&(t=this._longDateFormat[e.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e]=t),t},isPM:function(e){return"p"===(e+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var n=this._calendar[e];return"function"==typeof n?n.apply(t):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,r){var s=this._relativeTime[n];return"function"==typeof s?s(e,t,n,r):s.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return B(e,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),ut=function(n,r,s,a){var i;return"boolean"==typeof s&&(a=s,s=e),i={},i._isAMomentObject=!0,i._i=n,i._f=r,i._l=s,i._strict=a,i._isUTC=!1,i._pf=t(),et(i)},ut.suppressDeprecationWarnings=!1,ut.createFromInputFallback=n("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i)}),ut.utc=function(n,r,s,a){var i;return"boolean"==typeof s&&(a=s,s=e),i={},i._isAMomentObject=!0,i._useUTC=!0,i._isUTC=!0,i._l=s,i._i=n,i._f=r,i._strict=a,i._pf=t(),et(i).utc()},ut.unix=function(e){return ut(1e3*e)},ut.duration=function(e,t){var n,r,s,a=e,i=null;return ut.isDuration(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(a={},t?a[t]=e:a.milliseconds=e):(i=bt.exec(e))?(n="-"===i[1]?-1:1,a={y:0,d:Y(i[yt])*n,h:Y(i[pt])*n,m:Y(i[gt])*n,s:Y(i[Yt])*n,ms:Y(i[wt])*n}):(i=St.exec(e))&&(n="-"===i[1]?-1:1,s=function(e){var t=e&&parseFloat(e.replace(",","."));return(isNaN(t)?0:t)*n},a={y:s(i[2]),M:s(i[3]),d:s(i[4]),h:s(i[5]),m:s(i[6]),s:s(i[7]),w:s(i[8])}),r=new o(a),ut.isDuration(e)&&e.hasOwnProperty("_lang")&&(r._lang=e._lang),r},ut.version=ft,ut.defaultFormat=Vt,ut.momentProperties=Dt,ut.updateOffset=function(){},ut.lang=function(e,t){var n;return e?(t?O(S(e),t):null===t?(W(e),e="en"):Mt[e]||G(e),n=ut.duration.fn._lang=ut.fn._lang=G(e),n._abbr):ut.fn._lang._abbr},ut.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),G(e)},ut.isMoment=function(e){return e instanceof i||null!=e&&e.hasOwnProperty("_isAMomentObject")},ut.isDuration=function(e){return e instanceof o},dt=rn.length-1;dt>=0;--dt)g(rn[dt]);ut.normalizeUnits=function(e){return y(e)},ut.invalid=function(e){var t=ut.utc(0/0);return null!=e?u(t._pf,e):t._pf.userInvalidated=!0,t},ut.parseZone=function(){return ut.apply(null,arguments).parseZone()},ut.parseTwoDigitYear=function(e){return Y(e)+(Y(e)>68?1900:2e3)},u(ut.fn=i.prototype,{clone:function(){return ut(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var e=ut(this).utc();return 00:!1},parsingFlags:function(){return u({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(e){var t=P(this,e||ut.defaultFormat);return this.lang().postformat(t)},add:function(e,t){var n;return n="string"==typeof e?ut.duration(+t,e):ut.duration(e,t),h(this,n,1),this},subtract:function(e,t){var n;return n="string"==typeof e?ut.duration(+t,e):ut.duration(e,t),h(this,n,-1),this},diff:function(e,t,n){var r,s,a=T(e,this),i=6e4*(this.zone()-a.zone());return t=y(t),"year"===t||"month"===t?(r=432e5*(this.daysInMonth()+a.daysInMonth()),s=12*(this.year()-a.year())+(this.month()-a.month()),s+=(this-ut(this).startOf("month")-(a-ut(a).startOf("month")))/r,s-=6e4*(this.zone()-ut(this).startOf("month").zone()-(a.zone()-ut(a).startOf("month").zone()))/r,"year"===t&&(s/=12)):(r=this-a,s="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-i)/864e5:"week"===t?(r-i)/6048e5:r),n?s:d(s)},from:function(e,t){return ut.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!t)},fromNow:function(e){return this.from(ut(),e)},calendar:function(){var e=T(ut(),this).startOf("day"),t=this.diff(e,"days",!0),n=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(n,this))},isLeapYear:function(){return k(this.year())},isDST:function(){return this.zone()+ut(e).startOf(t)},isBefore:function(e,t){return t="undefined"!=typeof t?t:"millisecond",+this.clone().startOf(t)<+ut(e).startOf(t)},isSame:function(e,t){return t=t||"ms",+this.clone().startOf(t)===+T(e,this).startOf(t)},min:function(e){return e=ut.apply(null,arguments),this>e?this:e},max:function(e){return e=ut.apply(null,arguments),e>this?this:e},zone:function(e,t){var n=this._offset||0;return null==e?this._isUTC?n:this._d.getTimezoneOffset():("string"==typeof e&&(e=L(e)),Math.abs(e)<16&&(e=60*e),this._offset=e,this._isUTC=!0,n!==e&&(!t||this._changeInProgress?h(this,ut.duration(n-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ut.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(e){return e=e?ut(e).zone():0,(this.zone()-e)%60===0},daysInMonth:function(){return w(this.year(),this.month())},dayOfYear:function(e){var t=lt((ut(this).startOf("day")-ut(this).startOf("year"))/864e5)+1;return null==e?t:this.add("d",e-t)},quarter:function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},weekYear:function(e){var t=B(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==e?t:this.add("y",e-t)},isoWeekYear:function(e){var t=B(this,1,4).year;return null==e?t:this.add("y",e-t)},week:function(e){var t=this.lang().week(this);return null==e?t:this.add("d",7*(e-t))},isoWeek:function(e){var t=B(this,1,4).week;return null==e?t:this.add("d",7*(e-t))},weekday:function(e){var t=(this.day()+7-this.lang()._week.dow)%7;return null==e?t:this.add("d",e-t)},isoWeekday:function(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)},isoWeeksInYear:function(){return M(this.year(),1,4)},weeksInYear:function(){var e=this._lang._week;return M(this.year(),e.dow,e.doy)},get:function(e){return e=y(e),this[e]()},set:function(e,t){return e=y(e),"function"==typeof this[e]&&this[e](t),this},lang:function(t){return t===e?this._lang:(this._lang=G(t),this)}}),ut.fn.millisecond=ut.fn.milliseconds=st("Milliseconds",!1),ut.fn.second=ut.fn.seconds=st("Seconds",!1),ut.fn.minute=ut.fn.minutes=st("Minutes",!1),ut.fn.hour=ut.fn.hours=st("Hours",!0),ut.fn.date=st("Date",!0),ut.fn.dates=n("dates accessor is deprecated. Use date instead.",st("Date",!0)),ut.fn.year=st("FullYear",!0),ut.fn.years=n("years accessor is deprecated. Use year instead.",st("FullYear",!0)),ut.fn.days=ut.fn.day,ut.fn.months=ut.fn.month,ut.fn.weeks=ut.fn.week,ut.fn.isoWeeks=ut.fn.isoWeek,ut.fn.quarters=ut.fn.quarter,ut.fn.toJSON=ut.fn.toISOString,u(ut.duration.fn=o.prototype,{_bubble:function(){var e,t,n,r,s=this._milliseconds,a=this._days,i=this._months,o=this._data;o.milliseconds=s%1e3,e=d(s/1e3),o.seconds=e%60,t=d(e/60),o.minutes=t%60,n=d(t/60),o.hours=n%24,a+=d(n/24),o.days=a%30,i+=d(a/30),o.months=i%12,r=d(i/12),o.years=r},weeks:function(){return d(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*Y(this._months/12)},humanize:function(e){var t=+this,n=R(t,!e,this.lang());return e&&(n=this.lang().pastFuture(t,n)),this.lang().postformat(n)},add:function(e,t){var n=ut.duration(e,t);return this._milliseconds+=n._milliseconds,this._days+=n._days,this._months+=n._months,this._bubble(),this},subtract:function(e,t){var n=ut.duration(e,t);return this._milliseconds-=n._milliseconds,this._days-=n._days,this._months-=n._months,this._bubble(),this},get:function(e){return e=y(e),this[e.toLowerCase()+"s"]()},as:function(e){return e=y(e),this["as"+e.charAt(0).toUpperCase()+e.slice(1)+"s"]()},lang:ut.fn.lang,toIsoString:function(){var e=Math.abs(this.years()),t=Math.abs(this.months()),n=Math.abs(this.days()),r=Math.abs(this.hours()),s=Math.abs(this.minutes()),a=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(e?e+"Y":"")+(t?t+"M":"")+(n?n+"D":"")+(r||s||a?"T":"")+(r?r+"H":"")+(s?s+"M":"")+(a?a+"S":""):"P0D"}});for(dt in Xt)Xt.hasOwnProperty(dt)&&(it(dt,Xt[dt]),at(dt.toLowerCase()));it("Weeks",6048e5),ut.duration.fn.asMonths=function(){return(+this-31536e6*this.years())/2592e6+12*this.years()},ut.lang("en",{ordinal:function(e){var t=e%10,n=1===Y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),kt?module.exports=ut:"function"==typeof define&&define.amd?(define("moment",function(e,t,n){return n.config&&n.config()&&n.config().noGlobal===!0&&(ht.moment=ct),ut}),ot(!0)):ot()}).call(this); }).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],2:[function(_dereq_,module,exports){ -var Ouical,moment;moment=_dereq_("moment"),Ouical=function(){function t(t){var s;null==t&&(t={}),this.title=t.title||"",this.start=moment(t.start,"MM-DD-YYYY hh:mm"),this.address=t.address,this.description=t.description||"",t.end?this.end=moment(t.end,"MM-DD-YYYY hh:mm"):(s=moment.duration(t.duration,"minutes"),this.end=moment(this.start).add(s))}var s,i,e;return t.prototype.links=function(){return{google:s.call(this),yahoo:e.call(this),ics:i.call(this)}},s=function(){return encodeURI("https://www.google.com/calendar/render?action=TEMPLATE&text="+this.title+("&dates="+this.start.format("YYYYMMDDTHHmmss")+"Z/"+this.end.format("YYYYMMDDTHHmmss")+"Z")+("&details="+this.description)+("&location="+this.address)+"&sprop=&sprop=name:")},e=function(){var t;return t=this.end.diff(this.start,"minutes"),encodeURI("http://calendar.yahoo.com/?v=60&view=d&type=20&title="+this.title+("&st="+this.start.format("YYYYMMDDTHHmmss")+"Z")+("&dur="+t)+("&desc="+this.description)+("&in_loc="+this.address))},i=function(){return encodeURI("data:text/calendar;charset=utf8,"+["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT","DTSTART:"+this.start,"DTEND:"+this.end,"SUMMARY:"+this.title,"DESCRIPTION:"+this.description,"LOCATION:"+this.address,"END:VEVENT","END:VCALENDAR"].join("\n"))},t}(),module.exports=Ouical; +var Ouical,moment;moment=_dereq_("moment"),Ouical=function(){function t(t){var s;null==t&&(t={}),this.title=t.title||"",this.start=moment(t.start,"MM-DD-YYYY hh:mm"),this.address=t.address,this.description=t.description||"",t.end?this.end=moment(t.end,"MM-DD-YYYY hh:mm"):(s=moment.duration(t.duration,"minutes"),this.end=moment(this.start).add(s))}var s,i,e;return t.prototype.links=function(){return{google:s.call(this),yahoo:e.call(this),ics:i.call(this)}},s=function(){return encodeURI("https://www.google.com/calendar/render?action=TEMPLATE&text="+this.title+("&dates="+this.start.format("YYYYMMDDTHHmmss")+"Z/")+(""+this.end.format("YYYYMMDDTHHmmss")+"Z")+("&details="+this.description)+("&location="+this.address)+"&sprop=&sprop=name:")},e=function(){var t;return t=this.end.diff(this.start,"minutes"),encodeURI("http://calendar.yahoo.com/?v=60&view=d&type=20&title="+this.title+("&st="+this.start.format("YYYYMMDDTHHmmss")+"Z")+("&dur="+t)+("&desc="+this.description)+("&in_loc="+this.address))},i=function(){return encodeURI("data:text/calendar;charset=utf8,"+["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT","DTSTART:"+this.start,"DTEND:"+this.end,"SUMMARY:"+this.title,"DESCRIPTION:"+this.description,"LOCATION:"+this.address,"END:VEVENT","END:VCALENDAR"].join("\n"))},t}(),module.exports=Ouical; },{"moment":1}]},{},[2]) (2) diff --git a/package.json b/package.json index 12fadfc..754d591 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "uglifyify": "^2.1.1", "browserify": "~4.1.2", "coffeelint": "~1.3.0", - "chai-webdriver": "^0.8.0", - "selenium-webdriver": "^2.41.0" + "chai-webdriver": "~0.8.0", + "selenium-webdriver": "~2.41.0" } } diff --git a/test/browser.coffee b/test/browser.coffee index af7a014..4b2d57f 100644 --- a/test/browser.coffee +++ b/test/browser.coffee @@ -1,4 +1,6 @@ +path = require 'path' + describe 'browser', -> - it 'should work', -> - driver.get 'http://github.com' + it 'loads a page', (done) -> + driver.get("file://#{path.resolve('example/index.html')}").then(done) diff --git a/test/support/helper.js b/test/support/helper.js index defdcef..7165838 100644 --- a/test/support/helper.js +++ b/test/support/helper.js @@ -1,18 +1,14 @@ -var chai = require('chai') - , Ouical = require('../../src/ouical') - , chaiWebdriver = require('chai-webdriver') - , sw = require('selenium-webdriver'); +var chai = require('chai') + , Ouical = require('../../src/ouical') + , chai_webdriver = require('chai-webdriver') + , sw = require('selenium-webdriver'); -// just call should. use it in your tests -global.should = chai.should(); - -// make OuiCal available globally -global.Ouical = Ouical; - -// enable chai webdriver var driver = new sw.Builder() .withCapabilities(sw.Capabilities.chrome()) - .build(); + .build() -chai.use(chaiWebdriver(driver)); +chai.use(chai_webdriver(driver)); + +global.should = chai.should(); +global.Ouical = Ouical; global.driver = driver;