├── bower.json ├── demo ├── angular.min.js └── index.html ├── license.txt ├── package.json ├── readme.md ├── scripts └── minify.js └── source ├── ngComboDatePicker.js └── ngComboDatePicker.min.js /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ngComboDatePicker", 3 | "version": "1.5.1", 4 | "authors": [ 5 | "jfmdev " 6 | ], 7 | "description": "An Angular directive to select dates using combo boxes", 8 | "main": "source/ngComboDatePicker.js", 9 | "keywords": [ 10 | "angular", 11 | "directive", 12 | "calendar", 13 | "date", 14 | "picker", 15 | "date", 16 | "picker", 17 | "combobox" 18 | ], 19 | "license": "MPL-2.0", 20 | "homepage": "http://jfmdev.github.io/ngComboDatePicker/", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test", 26 | "tests" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /demo/angular.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.4.10 3 | (c) 2010-2015 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(U,W,v){'use strict';function L(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.4.10/"+(a?a+"/":"")+b;for(b=1;b").append(a).html();try{return a[0].nodeType===Oa?F(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+F(b)})}catch(c){return F(d)}}function wc(a){try{return decodeURIComponent(a)}catch(b){}} 17 | function xc(a){var b={};p((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,sa.call(b,e)?K(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Qb(a){var b=[];p(a,function(a,c){K(a)?p(a,function(a){b.push(ia(c,!0)+(!0===a?"":"="+ia(a,!0)))}):b.push(ia(c,!0)+(!0===a?"":"="+ia(a,!0)))});return b.length?b.join("&"):""}function nb(a){return ia(a,!0).replace(/%26/gi,"&").replace(/%3D/gi, 18 | "=").replace(/%2B/gi,"+")}function ia(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ce(a,b){var d,c,e=Pa.length;for(c=0;c/,">"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);b.unshift("ng");c=db(b,d.strictDi);c.invoke(["$rootScope", 20 | "$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;U&&e.test(U.name)&&(d.debugInfoEnabled=!0,U.name=U.name.replace(e,""));if(U&&!f.test(U.name))return c();U.name=U.name.replace(f,"");fa.resumeBootstrap=function(a){p(a,function(a){b.push(a)});return c()};E(fa.resumeDeferredBootstrap)&&fa.resumeDeferredBootstrap()}function ee(){U.name="NG_ENABLE_DEBUG_INFO!"+U.name;U.location.reload()} 21 | function fe(a){a=fa.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(ge,function(a,c){return(c?b:"")+a.toLowerCase()})}function he(){var a;if(!Ac){var b=ob();(qa=r(b)?U.jQuery:b?U[b]:v)&&qa.fn.on?(z=qa,M(qa.fn,{scope:Qa.scope,isolateScope:Qa.isolateScope,controller:Qa.controller,injector:Qa.injector,inheritedData:Qa.inheritedData}),a=qa.cleanData,qa.cleanData=function(b){var c;if(Rb)Rb=!1;else for(var e=0,f;null!=(f=b[e]);e++)(c= 22 | qa._data(f,"events"))&&c.$destroy&&qa(f).triggerHandler("$destroy");a(b)}):z=R;fa.element=z;Ac=!0}}function pb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Ra(a,b,d){d&&K(a)&&(a=a[a.length-1]);pb(E(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Sa(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2];for(c=c[0];c--;)d=d.lastChild;f=bb(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";p(f,function(a){e.appendChild(a)});return e}function Mc(a, 30 | b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function R(a){if(a instanceof R)return a;var b;H(a)&&(a=V(a),b=!0);if(!(this instanceof R)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new R(a)}if(b){b=W;var d;a=(d=Lf.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Nc(this,a)}function Vb(a){return a.cloneNode(!0)}function tb(a,b){b||ub(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;cm&&this.remove(G.key);return b}},get:function(a){if(m").append(a).html())):c?Qa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);J.$$addScopeInfo(d,b);c&&c(d,b);m&&m(b,d,d,f);return d}}function X(a,b,c,d,e,f){function g(a,c,d,e){var f,k,m,l,n,B,t;if(q)for(t=Array(c.length), 54 | l=0;lr.priority)break;if(Q=r.scope)r.templateUrl||(I(Q)?(Va("new/isolated scope",C||A,r,$),C=r):Va("new/isolated scope",C,r,$)),A=A||r;y=r.name;!r.templateUrl&&r.controller&&(Q=r.controller,u=u||aa(),Va("'"+y+"' controller",u[y],r,$),u[y]=r);if(Q=r.transclude)N=!0,r.$$tlb||(Va("transclusion",D, 63 | r,$),D=r),"element"==Q?(T=!0,P=r.priority,Q=$,$=d.$$element=z(W.createComment(" "+y+": "+d[y]+" ")),b=$[0],Z(f,ta.call(Q,0),b),Ha=J(Q,e,P,g&&g.name,{nonTlbTranscludeDirective:D})):(Q=z(Vb(b)).contents(),$.empty(),Ha=J(Q,e,v,v,{needsNewScope:r.$$isolateScope||r.$$newScope}));if(r.template)if(p=!0,Va("template",X,r,$),X=r,Q=E(r.template)?r.template($,d):r.template,Q=ia(Q),r.replace){g=r;Q=Tb.test(Q)?Yc(Yb(r.templateNamespace,V(Q))):[];b=Q[0];if(1!=Q.length||1!==b.nodeType)throw ga("tplrt",y,"");Z(f, 64 | $,b);Q={$attr:{}};var Xc=ja(b,[],Q),Y=a.splice(F+1,a.length-(F+1));(C||A)&&x(Xc,C,A);a=a.concat(Xc).concat(Y);U(d,Q);M=a.length}else $.html(Q);if(r.templateUrl)p=!0,Va("template",X,r,$),X=r,r.replace&&(g=r),w=Vf(a.splice(F,a.length-F),$,d,f,N&&Ha,h,m,{controllerDirectives:u,newScopeDirective:A!==r&&A,newIsolateScopeDirective:C,templateDirective:X,nonTlbTranscludeDirective:D}),M=a.length;else if(r.compile)try{L=r.compile($,d,Ha),E(L)?n(null,L,O,R):L&&n(L.pre,L.post,O,R)}catch(da){c(da,ua($))}r.terminal&& 65 | (w.terminal=!0,P=Math.max(P,r.priority))}w.scope=A&&!0===A.scope;w.transcludeOnThisElement=N;w.templateOnThisElement=p;w.transclude=Ha;l.hasElementTranscludeDirective=T;return w}function x(a,b,c){for(var d=0,e=a.length;dn.priority)&&-1!=n.restrict.indexOf(g)){m&&(n=Ob(n,{$$start:m,$$end:l})); 66 | if(!n.$$bindings){var t=n,J=n,P=n.name,w={isolateScope:null,bindToController:null};I(J.scope)&&(!0===J.bindToController?(w.bindToController=d(J.scope,P,!0),w.isolateScope={}):w.isolateScope=d(J.scope,P,!1));I(J.bindToController)&&(w.bindToController=d(J.bindToController,P,!0));if(I(w.bindToController)){var C=J.controller,u=J.controllerAs;if(!C)throw ga("noctrl",P);var D;a:{var J=C,X=u;if(X&&H(X))D=X;else{if(H(J)){var ja=Zc.exec(J);if(ja){D=ja[3];break a}}D=void 0}}if(!D)throw ga("noident",P);}var N= 67 | t.$$bindings=w;I(N.isolateScope)&&(n.$$isolateBindings=N.isolateScope)}b.push(n);h=n}}catch(p){c(p)}}return h}function L(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d"+b+"";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return D.HTML;var c=pa(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return D.RESOURCE_URL}function Y(a,c,d,e,f){var g=R(a,e);f=h[e]||f;var k= 72 | b(d,!0,g,f);if(k){if("multiple"===e&&"select"===pa(a))throw ga("selmulti",ua(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers=aa());if(m.test(e))throw ga("nodomevents");var l=h[e];l!==d&&(k=l&&b(l,!0,g,f),d=l);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function Z(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g= 73 | 0,h=a.length;g=b)return a;for(;b--;)8=== 80 | a[b].nodeType&&Wf.call(a,b,1);return a}function df(){var a={},b=!1;this.register=function(b,c){Sa(b,"controller");I(b)?M(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!I(a.$scope))throw L("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var m,l,n;h=!0===h;k&&H(k)&&(n=k);if(H(f)){k=f.match(Zc);if(!k)throw Xf("ctrlfmt",f);l=k[1];n=n||k[3];f=a.hasOwnProperty(l)?a[l]:Bc(g.$scope,l,!0)||(b?Bc(c,l,!0):v);Ra(f, 81 | l,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,m=Object.create(h||null),n&&e(g,n,m,l||f.name),M(function(){var a=d.invoke(f,m,g,l);a!==m&&(I(a)||E(a))&&(m=a,n&&e(g,n,m,l||f.name));return m},{instance:m,identifier:n});m=d.instantiate(f,g,l);n&&e(g,n,m,l||f.name);return m}}]}function ef(){this.$get=["$window",function(a){return z(a.document)}]}function ff(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function Zb(a){return I(a)?da(a)?a.toISOString():cb(a):a} 82 | function lf(){this.$get=function(){return function(a){if(!a)return"";var b=[];oc(a,function(a,c){null===a||r(a)||(K(a)?p(a,function(a,d){b.push(ia(c)+"="+ia(Zb(a)))}):b.push(ia(c)+"="+ia(Zb(a))))});return b.join("&")}}}function mf(){this.$get=function(){return function(a){function b(a,e,f){null===a||r(a)||(K(a)?p(a,function(a,c){b(a,e+"["+(I(a)?c:"")+"]")}):I(a)&&!da(a)?oc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ia(e)+"="+ia(Zb(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}} 83 | function $b(a,b){if(H(a)){var d=a.replace(Yf,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(bd))||(c=(c=d.match(Zf))&&$f[c[0]].test(d));c&&(a=uc(d))}}return a}function cd(a){var b=aa(),d;H(a)?p(a.split("\n"),function(a){d=a.indexOf(":");var e=F(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):I(a)&&p(a,function(a,d){var f=F(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function dd(a){var b;return function(d){b||(b=cd(a));return d?(d=b[F(d)],void 0===d&&(d=null), 84 | d):b}}function ed(a,b,d,c){if(E(c))return c(a,b,d);p(c,function(c){a=c(a,b,d)});return a}function kf(){var a=this.defaults={transformResponse:[$b],transformRequest:[function(a){return I(a)&&"[object File]"!==oa.call(a)&&"[object Blob]"!==oa.call(a)&&"[object FormData]"!==oa.call(a)?cb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ha(ac),put:ha(ac),patch:ha(ac)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync= 85 | function(a){return x(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,m){function l(b){function c(a){var b=M({},a);b.data=ed(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};p(a,function(a,e){E(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!fa.isObject(b))throw L("$http")("badreq", 86 | b);if(!H(b.url))throw L("$http")("badreq",b.url);var f=M({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=M({},b.headers),f,g,h,c=M({},c.common,c[F(b.method)]);a:for(f in c){g=F(f);for(h in d)if(F(h)===g)continue a;d[f]=c[f]}return e(d,ha(b))}(b);f.method=rb(f.method);f.paramSerializer=H(f.paramSerializer)?m.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers, 87 | e=ed(b.data,dd(d),v,b.transformRequest);r(e)&&p(d,function(a,b){"content-type"===F(b)&&delete d[b]});r(b.withCredentials)&&!r(a.withCredentials)&&(b.withCredentials=a.withCredentials);return n(b,e).then(c,c)},v],h=k.when(f);for(p(u,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var l=g.shift(),h=h.then(b,l)}d?(h.success=function(a){Ra(a,"fn");h.then(function(b){a(b.data,b.status, 88 | b.headers,f)});return h},h.error=function(a){Ra(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=fd("success"),h.error=fd("error"));return h}function n(c,d){function g(a,c,d,e){function f(){m(c,a,d,e)}C&&(200<=a&&300>a?C.put(P,[a,c,cd(d),e]):C.remove(P));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function m(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?p.resolve:p.reject)({data:a,status:b,headers:dd(d),config:c,statusText:e})}function n(a){m(a.data,a.status,ha(a.headers()), 89 | a.statusText)}function u(){var a=l.pendingRequests.indexOf(c);-1!==a&&l.pendingRequests.splice(a,1)}var p=k.defer(),B=p.promise,C,J,X=c.headers,P=G(c.url,c.paramSerializer(c.params));l.pendingRequests.push(c);B.then(u,u);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(C=I(c.cache)?c.cache:I(a.cache)?a.cache:A);C&&(J=C.get(P),x(J)?J&&E(J.then)?J.then(n,n):K(J)?m(J[1],J[0],ha(J[2]),J[3]):m(J,200,{},"OK"):C.put(P,B));r(J)&&((J=gd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]: 90 | v)&&(X[c.xsrfHeaderName||a.xsrfHeaderName]=J),e(c.method,P,d,g,X,c.timeout,c.withCredentials,c.responseType));return B}function G(a,b){0=k&&(q.resolve(u),A(w.$$intervalId),delete f[w.$$intervalId]);S||a.$apply()}, 98 | h);f[w.$$intervalId]=q;return w}var f={};e.cancel=function(a){return a&&a.$$intervalId in f?(f[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete f[a.$$intervalId],!0):!1};return e}]}function bc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=nb(a[b]);return a.join("/")}function hd(a,b){var d=wa(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=ea(d.port)||bg[d.protocol]||null}function id(a,b){var d="/"!==a.charAt(0);d&&(a="/"+a);var c=wa(a);b.$$path=decodeURIComponent(d&& 99 | "/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function ra(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Fa(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function hb(a){return a.replace(/(#.+)|#$/,"$1")}function cc(a,b,d){this.$$html5=!0;d=d||"";hd(a,this);this.$$parse=function(a){var d=ra(b,a);if(!H(d))throw Cb("ipthprfx",a,b);id(d,this);this.$$path|| 100 | (this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Qb(this.$$search),d=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=bc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;x(f=ra(a,c))?(g=f,g=x(f=ra(d,f))?b+(ra("/",f)||f):a+g):x(f=ra(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function dc(a,b,d){hd(a,this);this.$$parse=function(c){var e=ra(a,c)||ra(b,c),f;r(e)||"#"!== 101 | e.charAt(0)?this.$$html5?f=e:(f="",r(e)&&(a=c,this.replace())):(f=ra(d,e),r(f)&&(f=e));id(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Qb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=bc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=function(b,d){return Fa(a)==Fa(b)?(this.$$parse(b),!0):!1}}function jd(a, 102 | b,d){this.$$html5=!0;dc.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Fa(c)?f=c:(g=ra(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Qb(this.$$search),e=this.$$hash?"#"+nb(this.$$hash):"";this.$$url=bc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Db(a){return function(){return this[a]}}function kd(a,b){return function(d){if(r(d))return this[a];this[a]=b(d);this.$$compose(); 103 | return this}}function pf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return x(b)?(a=b,this):a};this.html5Mode=function(a){return Ma(a)?(b.enabled=a,this):I(a)?(Ma(a.enabled)&&(b.enabled=a.enabled),Ma(a.requireBase)&&(b.requireBase=a.requireBase),Ma(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=m.url(),f=m.$$state;try{c.url(a,b,d),m.$$state= 104 | c.state()}catch(g){throw m.url(e),m.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",m.absUrl(),a,m.$$state,b)}var m,l;l=c.baseHref();var n=c.url(),G;if(b.enabled){if(!l&&b.requireBase)throw Cb("nobase");G=n.substring(0,n.indexOf("/",n.indexOf("//")+2))+(l||"/");l=e.history?cc:jd}else G=Fa(n),l=dc;var A=G.substr(0,Fa(G).lastIndexOf("/")+1);m=new l(G,A,"#"+a);m.$$parseLinkUrl(n,n);m.$$state=c.state();var u=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&& 105 | !a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=z(a.target);"a"!==pa(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");I(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=wa(h.animVal).href);u.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!m.$$parseLinkUrl(h,k)||(a.preventDefault(),m.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});hb(m.absUrl())!=hb(n)&&c.url(m.absUrl(),!0);var S=!0;c.onUrlChange(function(a, 106 | b){r(ra(A,a))?g.location.href=a:(d.$evalAsync(function(){var c=m.absUrl(),e=m.$$state,f;a=hb(a);m.$$parse(a);m.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;m.absUrl()===a&&(f?(m.$$parse(c),m.$$state=e,h(c,!1,e)):(S=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=hb(c.url()),b=hb(m.absUrl()),f=c.state(),g=m.$$replace,l=a!==b||m.$$html5&&e.history&&f!==m.$$state;if(S||l)S=!1,d.$evalAsync(function(){var b=m.absUrl(),c=d.$broadcast("$locationChangeStart", 107 | b,a,m.$$state,f).defaultPrevented;m.absUrl()===b&&(c?(m.$$parse(a),m.$$state=f):(l&&h(b,g,f===m.$$state?null:m.$$state),k(a,f)))});m.$$replace=!1});return m}]}function qf(){var a=!0,b=this;this.debugEnabled=function(b){return x(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console|| 108 | {},e=b[a]||b.log||y;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];p(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Wa(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===a||"__proto__"===a)throw ba("isecfld",b);return a}function ld(a,b){a+= 109 | "";if(!H(a))throw ba("iseccst",b);return a}function xa(a,b){if(a){if(a.constructor===a)throw ba("isecfn",b);if(a.window===a)throw ba("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ba("isecdom",b);if(a===Object)throw ba("isecobj",b);}return a}function md(a,b){if(a){if(a.constructor===a)throw ba("isecfn",b);if(a===cg||a===dg||a===eg)throw ba("isecff",b);}}function Eb(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||a==={}.constructor||a===[].constructor|| 110 | a===Function.constructor))throw ba("isecaf",b);}function fg(a,b){return"undefined"!==typeof a?a:b}function nd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function Y(a,b){var d,c;switch(a.type){case s.Program:d=!0;p(a.body,function(a){Y(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:Y(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;break;case s.BinaryExpression:Y(a.left, 111 | b);Y(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:Y(a.left,b);Y(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:Y(a.test,b);Y(a.alternate,b);Y(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=!1;a.toWatch=[a];break;case s.MemberExpression:Y(a.object, 112 | b);a.computed&&Y(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];p(a.arguments,function(a){Y(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:Y(a.left,b);Y(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];p(a.elements, 113 | function(a){Y(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];p(a.properties,function(a){Y(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1,a.toWatch=[]}}function od(a){if(1==a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:v}}function pd(a){return a.type===s.Identifier||a.type===s.MemberExpression} 114 | function qd(a){if(1===a.body.length&&pd(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function sd(a,b){this.astBuilder=a;this.$filter=b}function td(a,b){this.astBuilder=a;this.$filter=b}function Fb(a){return"constructor"==a} 115 | function ec(a){return E(a.valueOf)?a.valueOf():gg.call(a)}function rf(){var a=aa(),b=aa();this.$get=["$filter",function(d){function c(c,f,n){var t,p,D;n=n||u;switch(typeof c){case "string":D=c=c.trim();var r=n?b:a;t=r[D];if(!t){":"===c.charAt(0)&&":"===c.charAt(1)&&(p=!0,c=c.substring(2));t=n?A:G;var B=new fc(t);t=(new gc(B,d,t)).parse(c);t.constant?t.$$watchDelegate=m:p?t.$$watchDelegate=t.literal?k:h:t.inputs&&(t.$$watchDelegate=g);n&&(t=e(t));r[D]=t}return l(t,f);case "function":return l(c,f); 116 | default:return l(y,f)}}function e(a){function b(c,d,e,f){var g=u;u=!0;try{return a(c,d,e,f)}finally{u=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=e(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&c=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;fa)for(b in l++,f)sa.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,g,k=1r&&(T= 133 | 4-r,u[T]||(u[T]=[]),u[T].push({msg:E(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:f,oldVal:h}));else if(a===c){A=!1;break a}}catch(y){g(y)}if(!(n=w.$$watchersCount&&w.$$childHead||w!==this&&w.$$nextSibling))for(;w!==this&&!(n=w.$$nextSibling);)w=w.$parent}while(w=n);if((A||N.length)&&!r--)throw t.$$phase=null,d("infdig",b,u);}while(A||N.length);for(t.$$phase=null;D.length;)try{D.shift()()}catch(z){g(z)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"); 134 | this.$$destroyed=!0;this===t&&k.$$applicationDestroyed();A(this,-this.$$watchersCount);for(var b in this.$$listenerCount)u(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=y;this.$on= 135 | this.$watch=this.$watchGroup=function(){return y};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a,b){t.$$phase||N.length||k.defer(function(){N.length&&t.$digest()});N.push({scope:this,expression:h(a),locals:b})},$$postDigest:function(a){D.push(a)},$apply:function(a){try{G("$apply");try{return this.$eval(a)}finally{t.$$phase=null}}catch(b){g(b)}finally{try{t.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)} 136 | var c=this;a&&T.push(b);a=h(a);w()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,u(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=bb([h],arguments,1),l,m;do{d= 137 | e.$$listeners[a]||c;h.currentScope=e;l=0;for(m=d.length;lGa)throw ya("iequirks");var c=ha(la);c.isEnabled=function(){return a}; 143 | c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=Za);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;p(la,function(a,b){var d=F(b);c[eb("parse_as_"+d)]=function(b){return e(a,b)};c[eb("get_trusted_"+d)]=function(b){return f(a,b)};c[eb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function xf(){this.$get=["$window", 144 | "$document",function(a,b){var d={},c=ea((/android (\d+)/.exec(F((a.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((a.navigator||{}).userAgent),f=b[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,k=f.body&&f.body.style,m=!1,l=!1;if(k){for(var n in k)if(m=h.exec(n)){g=m[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit");m=!!("transition"in k||g+"Transition"in k);l=!!("animation"in k||g+"Animation"in k);!c||m&&l||(m=H(k.webkitTransition),l=H(k.webkitAnimation))}return{history:!(!a.history|| 145 | !a.history.pushState||4>c||e),hasEvent:function(a){if("input"===a&&11>=Ga)return!1;if(r(d[a])){var b=f.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ba(),vendorPrefix:g,transitions:m,animations:l,android:c}}]}function zf(){this.$get=["$templateCache","$http","$q","$sce",function(a,b,d,c){function e(f,g){e.totalPendingRequests++;H(f)&&a.get(f)||(f=c.getTrustedResourceUrl(f));var h=b.defaults&&b.defaults.transformResponse;K(h)?h=h.filter(function(a){return a!==$b}):h===$b&&(h=null);return b.get(f, 146 | {cache:a,transformResponse:h})["finally"](function(){e.totalPendingRequests--}).then(function(b){a.put(f,b.data);return b.data},function(a){if(!g)throw ga("tpload",f,a.status,a.statusText);return d.reject(a)})}e.totalPendingRequests=0;return e}]}function Af(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];p(a,function(a){var c=fa.element(a).data("$binding");c&&p(c,function(c){d?(new RegExp("(^|\\s)"+ 147 | vd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;hc&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==ic;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==ic;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Fd&&(d=d.splice(0,Fd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function pg(a,b,d,c){var e=a.d,f=e.length-a.i;b=r(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0h;)k.unshift(0),h++;0b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join("")); 156 | k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Gb(a,b,d){var c="";0>a&&(c="-",a=-a);for(a=""+a;a.length-d)e+=d;0===e&&-12==d&&(e=12);return Gb(e,b,c)}}function Hb(a,b){return function(d,c){var e=d["get"+a](),f=rb(b?"SHORT"+a:a);return c[f][e]}}function Gd(a){var b=(new Date(a, 157 | 0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Hd(a){return function(b){var d=Gd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Gb(b,a)}}function jc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Ad(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ea(b[9]+b[10]),g=ea(b[9]+b[11]));h.call(a,ea(b[1]),ea(b[2])- 158 | 1,ea(b[3]));f=ea(b[4]||0)-f;g=ea(b[5]||0)-g;h=ea(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=[],k,m;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;H(c)&&(c=qg.test(c)?ea(c):b(c));O(c)&&(c=new Date(c));if(!da(c)||!isFinite(c.getTime()))return c;for(;d;)(m=rg.exec(d))?(h=bb(h,m,1),d=h.pop()):(h.push(d),d=null);var l=c.getTimezoneOffset(); 159 | f&&(l=vc(f,l),c=Pb(c,f,!0));p(h,function(b){k=sg[b];g+=k?k(c,a.DATETIME_FORMATS,l):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function jg(){return function(a,b){r(b)&&(b=2);return cb(a,b)}}function kg(){return function(a,b,d){b=Infinity===Math.abs(Number(b))?Number(b):ea(b);if(isNaN(b))return a;O(a)&&(a=a.toString());if(!K(a)&&!H(a))return a;d=!d||isNaN(d)?0:ea(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b), 160 | d)}}function Cd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Za;if(E(b))h=b;else if(H(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h,descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(!za(a))return a;K(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}}, 161 | descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===c)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),d(e)))break a;if(qc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;db||37<=b&&40>=b||l(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",l)}b.on("change",m);if(Kd[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch=== 167 | d||m(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Kb(a,b){return function(d,c){var e,f;if(da(d))return d;if(H(d)){'"'==d.charAt(0)&&'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(tg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0, 168 | ss:0,sss:0},p(e,function(a,c){c=s};g.$observe("min",function(a){s=p(a);h.$validate()})}if(x(g.max)||g.ngMax){var q;h.$validators.max=function(a){return!n(a)||r(q)||d(a)<=q};g.$observe("max",function(a){q=p(a);h.$validate()})}}}function Ld(a,b,d,c){(c.$$hasNativeValidators=I(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{}; 170 | return c.badInput&&!c.typeMismatch?v:a})}function Md(a,b,d,c,e){if(x(c)){a=a(c);if(!a.constant)throw kb("constexpr",d,c);return a(b)}return e}function lc(a,b){a="ngClass"+a;return["$animate",function(d){function c(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/, 177 | Tb=/<|&#?\w+;/,Jf=/<([\w:-]+)/,Kf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ka={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ka.optgroup=ka.option;ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead;ka.th=ka.td;var Rf=Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)& 178 | 16)},Qa=R.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===W.readyState?setTimeout(b):(this.on("DOMContentLoaded",b),R(U).on("load",b))},toString:function(){var a=[];p(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?z(this[a]):z(this[this.length+a])},length:0,push:vg,sort:[].sort,splice:[].splice},Bb={};p("multiple selected checked disabled readOnly required open".split(" "),function(a){Bb[F(a)]=a});var Sc={};p("input select option textarea button form details".split(" "), 179 | function(a){Sc[a]=!0});var ad={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};p({data:Wb,removeData:ub,hasData:function(a){for(var b in fb[a.ng339])return!0;return!1}},function(a,b){R[b]=a});p({data:Wb,inheritedData:Ab,scope:function(a){return z.data(a,"$scope")||Ab(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return z.data(a,"$isolateScope")||z.data(a,"$isolateScopeNoTemplate")},controller:Pc,injector:function(a){return Ab(a, 180 | "$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:xb,css:function(a,b,d){b=eb(b);if(x(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Oa&&2!==c&&8!==c)if(c=F(b),Bb[c])if(x(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||y).specified?c:v;else if(x(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?v:a},prop:function(a,b,d){if(x(d))a[b]=d;else return a[b]}, 181 | text:function(){function a(a,d){if(r(d)){var c=a.nodeType;return 1===c||c===Oa?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(r(b)){if(a.multiple&&"select"===pa(a)){var d=[];p(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(r(b))return a.innerHTML;tb(a,!0);a.innerHTML=b},empty:Qc},function(a,b){R.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Qc&&r(2==a.length&&a!==xb&&a!==Pc? 182 | b:c)){if(I(b)){for(e=0;e <= >= && || ! = |".split(" "),function(a){Lb[a]=!0});var Bg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},fc=function(a){this.options= 201 | a};fc.prototype={constructor:fc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<= 203 | a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=x(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ba("lexerr",a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+", 211 | "-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=Na(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(", 212 | "[",".");)"("===b.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b}, 213 | parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]"); 214 | return{type:s.ArrayExpression,elements:a}},object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw ba("syntax",b.text,a,b.index+1,this.text, 215 | this.text.substring(b.index));},consume:function(a){if(0===this.tokens.length)throw ba("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ba("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1}, 216 | expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?(this.tokens.shift(),a):!1},constants:{"true":{type:s.Literal,value:!0},"false":{type:s.Literal,value:!1},"null":{type:s.Literal,value:null},undefined:{type:s.Literal,value:v},"this":{type:s.ThisExpression}}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};Y(c,d.$filter);var e="",f;this.stage="assign"; 217 | if(f=qd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=od(c.body);d.stage="inputs";p(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+ 218 | e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",e))(this.$filter,Wa,xa,md,ld,Eb,fg,nd,a);this.state=this.stage=v;e.literal=rd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;p(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")}, 219 | generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;p(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,m,l;c=c||y;if(!f&&x(a.watchId))b=b||this.nextId(),this.if_("i", 220 | this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:p(a.body,function(b,c){k.recurse(b.expression,v,v,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:l=this.escape(a.value);this.assign(b,l);c(l);break;case s.UnaryExpression:this.recurse(a.argument,v,v,function(a){h=a});l=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,l);c(l);break;case s.BinaryExpression:this.recurse(a.left, 221 | v,v,function(a){g=a});this.recurse(a.right,v,v,function(a){h=a});l="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,l);c(l);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b); 222 | break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name);Wa(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l", 223 | a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId();b=b||this.nextId();k.recurse(a.object,g,v,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),l=k.ensureSafeObject(k.computedMember(g, 224 | h)),k.assign(b,l),d&&(d.computed=!0,d.name=h);else{Wa(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));l=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))l=k.ensureSafeObject(l);k.assign(b,l);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),m=[],p(a.arguments, 225 | function(a){var b=k.nextId();k.recurse(a,b);m.push(b)}),l=h+"("+m.join(",")+")",k.assign(b,l),c(b)):(h=k.nextId(),g={},m=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);p(a.arguments,function(a){k.recurse(a,k.nextId(),v,function(a){m.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),l=k.member(g.context,g.name,g.computed)+"("+m.join(",")+")"):l=h+"("+m.join(",")+")";l=k.ensureSafeObject(l);k.assign(b,l)}, 226 | function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!pd(a.left))throw ba("lval");this.recurse(a.left,v,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);l=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,l);c(b||l)})},1);break;case s.ArrayExpression:m=[];p(a.elements,function(a){k.recurse(a,k.nextId(),v,function(a){m.push(a)})}); 227 | l="["+m.join(",")+"]";this.assign(b,l);c(l);break;case s.ObjectExpression:m=[];p(a.properties,function(a){k.recurse(a.value,k.nextId(),v,function(b){m.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});l="{"+m.join(",")+"}";this.assign(b,l);c(l);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+ 228 | this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a, 229 | "){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){return a+"."+b},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")}, 230 | addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+",text)")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+ 231 | a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(H(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(O(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"=== 232 | typeof a)return"undefined";throw ba("esc");},nextId:function(a,b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;Y(c,d.$filter);var e,f;if(e=qd(c))f=this.recurse(e);e=od(c.body);var g;e&&(g=[],p(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];p(c.body,function(a){h.push(d.recurse(a.expression))}); 233 | e=0===c.body.length?function(){}:1===c.body.length?h[0]:function(a,b){var c;p(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=rd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left), 234 | e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Wa(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Fb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Wa(a.property.name, 235 | f.expression),e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],p(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var n=[],p=0;p":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c, 241 | e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:v,name:v,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f= 242 | g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:v;b&&xa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var m=a(f,g,h,k),l,n;null!=m&&(l=b(f,g,h,k),l=ld(l),Wa(l,e),c&&1!==c&&(Eb(m),m&&!m[l]&&(m[l]={})),n=m[l],xa(n,e));return d?{context:m,name:l,value:n}:n}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,m){g=a(g,h,k,m);e&&1!==e&&(Eb(g),g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:v;(d||Fb(b))&&xa(h,f);return c?{context:g,name:b,value:h}: 243 | h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var gc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(this.lexer);this.astCompiler=d.csp?new td(this.ast,b):new sd(this.ast,b)};gc.prototype={constructor:gc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var gg=Object.prototype.valueOf,ya=L("$sce"),la={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ga=L("$compile"),Z=W.createElement("a"), 244 | xd=wa(U.location.href);yd.$inject=["$document"];Jc.$inject=["$provide"];var Fd=22,Ed=".",ic="0";zd.$inject=["$locale"];Bd.$inject=["$locale"];var sg={yyyy:ca("FullYear",4),yy:ca("FullYear",2,0,!0),y:ca("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:ca("Month",2,1),M:ca("Month",1,1),dd:ca("Date",2),d:ca("Date",1),HH:ca("Hours",2),H:ca("Hours",1),hh:ca("Hours",2,-12),h:ca("Hours",1,-12),mm:ca("Minutes",2),m:ca("Minutes",1),ss:ca("Seconds",2),s:ca("Seconds",1),sss:ca("Milliseconds",3),EEEE:Hb("Day"), 245 | EEE:Hb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},rg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,qg=/^\-?\d+$/;Ad.$inject=["$locale"];var lg=na(F),mg=na(rb);Cd.$inject=["$parse"];var me=na({restrict:"E",compile:function(a, 246 | b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===oa.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),sb={};p(Bb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=va("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)});sb[c]=function(){return{restrict:"A",priority:100,link:e}}}});p(ad,function(a,b){sb[b]= 247 | function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(ug))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});p(["src","srcset","href"],function(a){var b=va("ng-"+a);sb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===oa.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b), 248 | Ga&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Ib={$addControl:y,$$renameControl:function(a,b){a.$name=b},$removeControl:y,$setValidity:y,$setDirty:y,$setPristine:y,$setSubmitted:y};Id.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Rd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||y}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Id,compile:function(d,f){d.addClass(Xa).addClass(lb); 249 | var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var n=f[0];if(!("action"in e)){var p=function(b){a.$apply(function(){n.$commitViewValue();n.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",p,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",p,!1)},0,!1)})}(f[1]||n.$$parentForm).$addControl(n);var r=g?c(n.$name):y;g&&(r(a,n),e.$observe(g,function(b){n.$name!==b&&(r(a,v),n.$$parentForm.$$renameControl(n,b),r=c(n.$name),r(a,n))})); 250 | d.on("$destroy",function(){n.$$parentForm.$removeControl(n);r(a,v);M(n,Ib)})}}}}}]},ne=Rd(),Ae=Rd(!0),tg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Cg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Dg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Eg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Sd=/^(\d{4})-(\d{2})-(\d{2})$/,Td=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/, 251 | mc=/^(\d{4})-W(\d\d)$/,Ud=/^(\d{4})-(\d\d)$/,Vd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Kd=aa();p(["date","datetime-local","month","time","week"],function(a){Kd[a]=!0});var Wd={text:function(a,b,d,c,e,f){ib(a,b,d,c,e,f);kc(c)},date:jb("date",Sd,Kb(Sd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":jb("datetimelocal",Td,Kb(Td,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:jb("time",Vd,Kb(Vd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:jb("week",mc,function(a,b){if(da(a))return a; 252 | if(H(a)){mc.lastIndex=0;var d=mc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Gd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:jb("month",Ud,Kb(Ud,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Ld(a,b,d,c);ib(a,b,d,c,e,f);c.$$parserName="number";c.$parsers.push(function(a){return c.$isEmpty(a)?null:Eg.test(a)?parseFloat(a):v});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!O(a))throw kb("numfmt", 253 | a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||r(g)||a>=g};d.$observe("min",function(a){x(a)&&!O(a)&&(a=parseFloat(a,10));g=O(a)&&!isNaN(a)?a:v;c.$validate()})}if(x(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||r(h)||a<=h};d.$observe("max",function(a){x(a)&&!O(a)&&(a=parseFloat(a,10));h=O(a)&&!isNaN(a)?a:v;c.$validate()})}},url:function(a,b,d,c,e,f){ib(a,b,d,c,e,f);kc(c);c.$$parserName="url";c.$validators.url= 254 | function(a,b){var d=a||b;return c.$isEmpty(d)||Cg.test(d)}},email:function(a,b,d,c,e,f){ib(a,b,d,c,e,f);kc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Dg.test(d)}},radio:function(a,b,d,c){r(d.name)&&b.attr("name",++mb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Md(h,a,"ngTrueValue",d.ngTrueValue, 255 | !0),m=Md(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return ma(a,k)});c.$parsers.push(function(a){return a?k:m})},hidden:y,button:y,submit:y,reset:y,file:y},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Wd[F(g.type)]||Wd.text)(e,f, 256 | g,h[0],b,a,d,c)}}}}],Fg=/^(true|false|\d+)$/,Se=function(){return{restrict:"A",priority:100,compile:function(a,b){return Fg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},se=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=r(a)?"":a})}}}}],ue=["$interpolate","$compile", 257 | function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=r(a)?"":a})}}}}],te=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))|| 258 | "")})}}}}],Re=na({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),ve=lc("",!0),xe=lc("Odd",0),we=lc("Even",1),ye=Ka({compile:function(a,b){b.$set("ngCloak",v);a.removeClass("ng-cloak")}}),ze=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Ic={},Gg={blur:!0,focus:!0};p("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "), 259 | function(a){var b=va("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Gg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Ce=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(b,d,c,e,f){var g,h,k;b.$watch(c.ngIf,function(b){b?h||f(function(b,e){h=e;b[b.length++]=W.createComment(" end ngIf: "+ 260 | c.ngIf+" ");g={clone:b};a.enter(b,d.parent(),d)}):(k&&(k.remove(),k=null),h&&(h.$destroy(),h=null),g&&(k=qb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],De=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:fa.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,l,n,p){var r=0,u,s,q,w=function(){s&&(s.remove(),s=null);u&&(u.$destroy(),u=null);q&& 261 | (d.leave(q).then(function(){s=null}),s=q,q=null)};c.$watch(f,function(f){var l=function(){!x(h)||h&&!c.$eval(h)||b()},D=++r;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&D===r){var b=c.$new();n.template=a;a=p(b,function(a){w();d.enter(a,null,e).then(l)});u=b;q=a;u.$emit("$includeContentLoaded",f);c.$eval(g)}},function(){c.$$destroyed||D!==r||(w(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(w(),n.template=null)})}}}}],Ue=["$compile",function(a){return{restrict:"ECA", 262 | priority:-400,require:"ngInclude",link:function(b,d,c,e){/SVG/.test(d[0].toString())?(d.empty(),a(Lc(e.template,W).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ee=Ka({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),Qe=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!r(a)){var b= 263 | [];a&&p(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){return K(a)?a.join(e):v});c.$isEmpty=function(a){return!a||!a.length}}}},lb="ng-valid",Nd="ng-invalid",Xa="ng-pristine",Jb="ng-dirty",Pd="ng-pending",kb=L("ngModel"),Hg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,m){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=v;this.$validators={};this.$asyncValidators= 264 | {};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=v;this.$name=m(d.name||"",!1)(a);this.$$parentForm=Ib;var l=e(d.ngModel),n=l.assign,s=l,A=n,u=null,z,q=this;this.$$setOptions=function(a){if((q.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");s=function(a){var c=l(a);E(c)&&(c=b(a));return c};A=function(a, 265 | b){E(l(a))?f(a,{$$$p:q.$modelValue}):n(a,q.$modelValue)}}else if(!l.assign)throw kb("nonassign",d.ngModel,ua(c));};this.$render=y;this.$isEmpty=function(a){return r(a)||""===a||null===a||a!==a};var w=0;Jd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){q.$dirty=!1;q.$pristine=!0;f.removeClass(c,Jb);f.addClass(c,Xa)};this.$setDirty=function(){q.$dirty=!0;q.$pristine=!1;f.removeClass(c,Xa);f.addClass(c,Jb);q.$$parentForm.$setDirty()}; 266 | this.$setUntouched=function(){q.$touched=!1;q.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};this.$setTouched=function(){q.$touched=!0;q.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(u);q.$viewValue=q.$$lastCommittedViewValue;q.$render()};this.$validate=function(){if(!O(q.$modelValue)||!isNaN(q.$modelValue)){var a=q.$$rawModelValue,b=q.$valid,c=q.$modelValue,d=q.$options&&q.$options.allowInvalid;q.$$runValidators(a,q.$$lastCommittedViewValue, 267 | function(e){d||b===e||(q.$modelValue=e?a:v,q.$modelValue!==c&&q.$$writeModelToScope())})}};this.$$runValidators=function(a,b,c){function d(){var c=!0;p(q.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(p(q.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;p(q.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!E(h.then))throw kb("nopromise",h);f(g,v);c.push(h.then(function(){f(g,!0)},function(a){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)}, 268 | y):g(!0)}function f(a,b){h===w&&q.$setValidity(a,b)}function g(a){h===w&&c(a)}w++;var h=w;(function(){var a=q.$$parserName||"parse";if(r(z))f(a,null);else return z||(p(q.$validators,function(a,b){f(b,null)}),p(q.$asyncValidators,function(a,b){f(b,null)})),f(a,z),z;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=q.$viewValue;g.cancel(u);if(q.$$lastCommittedViewValue!==a||""===a&&q.$$hasNativeValidators)q.$$lastCommittedViewValue=a,q.$pristine&&this.$setDirty(),this.$$parseAndValidate()}; 269 | this.$$parseAndValidate=function(){var b=q.$$lastCommittedViewValue;if(z=r(b)?v:!0)for(var c=0;ce||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=ea(a)||0;c.$validate()}); 297 | c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};U.angular.bootstrap?U.console&&console.log("WARNING: Tried to load angular more than once."):(he(),je(fa),fa.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6, 298 | MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a", 299 | shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=a|0,f=c;v===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),z(W).ready(function(){de(W,yc)}))})(window,document); 300 | !window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''); 301 | //# sourceMappingURL=angular.min.js.map 302 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ngComboDatePicker demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 18 | 19 | 20 |

ngComboDatePicker demos

21 | 22 |
23 |

Basic example

24 | 29 |
30 |

Choose a date:

31 |

Current selection is: {{ basic }}

32 |

33 | 34 | 35 |

Change order of combo boxes

36 | 41 |
42 |

Choose a date:

43 |

Current selection is: {{ change }}

44 |

45 | 46 | 47 |

Set initial date

48 | 49 | 50 |

To fixed value

51 | 56 |
57 |

Choose a date:

58 |

Current selection is: {{ fixed }}

59 |

60 | 61 | 62 |

To dynamic value

63 | 69 |
70 |

Choose a date:

71 |

Current selection is: {{ dynamic }}

72 |

73 | 74 | 75 |

To empty value

76 |
77 |

Choose a date:

78 |

Current selection is: {{ emptyDate }}

79 |

80 | 81 | 82 |

Define minimum and maximum dates

83 | 84 | 85 |

Statically

86 | 91 |
92 |

Choose a date:

93 |

Current selection is: {{ range }}

94 |

95 | 96 | 97 |

Dynamically

98 | 106 |
107 |

Minimum date:

108 |

Maximum date:

109 |

Choose a date:

110 |

Current selection is: {{ dyn_range }}

111 |

112 | 113 | 114 |

Change strings for months

115 | 120 |
121 |

Choose a date:

122 |

Current selection is: {{ names }}

123 |

124 | 125 | 126 |

Define attributtes (for each combobox)

127 | 128 |

Styles

129 | 134 |
135 |

Choose a date:

136 |

Current selection is: {{ attrs }}

137 |

138 | 139 |

Classes

140 | 141 | 146 | 152 |
153 |

Choose a date:

154 |

Current selection is: {{ classes }}

155 |

156 | 157 |

Change years order

158 | 163 |
164 |

Choose a date:

165 |

Current selection is: {{ yearsOrder }}

166 |

167 | 168 | 169 |

Timezones

170 |
171 |

Choose a date:

172 |

Current selection is: {{ timezone1 }}

173 |

Choose a date:

174 |

Current selection is: {{ timezone2 }}

175 |

Choose a date:

176 |

Current selection is: {{ timezone3 }}

177 |

178 | 179 | 180 |

Place holders

181 |
182 |

Choose a date:

183 |

Current selection is: {{ placeholder }}

184 |

185 | 186 |

Form validation

187 | 188 |

Using inners <select>

189 | 194 |
195 |
196 |

Choose a date:

197 |

Current selection is: {{ formv }}

198 |

Form is valid: {{ myForm.$invalid? 'No' : 'Yes' }}

199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 |
FieldPristineDirtyTouchedUntouched
Date{{ myForm.formv_date.$pristine? 'Yes' : 'No' }}{{ myForm.formv_date.$dirty? 'Yes' : 'No' }}{{ myForm.formv_date.$touched? 'Yes' : 'No' }}{{ myForm.formv_date.$untouched? 'Yes' : 'No' }}
Month{{ myForm.formv_month.$pristine? 'Yes' : 'No' }}{{ myForm.formv_month.$dirty? 'Yes' : 'No' }}{{ myForm.formv_month.$touched? 'Yes' : 'No' }}{{ myForm.formv_month.$untouched? 'Yes' : 'No' }}
Year{{ myForm.formv_year.$pristine? 'Yes' : 'No' }}{{ myForm.formv_year.$dirty? 'Yes' : 'No' }}{{ myForm.formv_year.$touched? 'Yes' : 'No' }}{{ myForm.formv_year.$untouched? 'Yes' : 'No' }}
229 |
230 |
231 | 232 |

Using ngRequired and name

233 | 238 |
239 |
240 |

Choose a date:

241 |

Current selection is: {{ requiredDate }}

242 |

Date selector is dirty: {{ myOtherForm.my_date.$dirty? 'Yes' : 'No' }}

243 |

Date selector is valid: {{ myOtherForm.my_date.$invalid? 'No' : 'Yes' }}

244 |

Date selector was touched: {{ myOtherForm.my_date.$touched? 'Yes' : 'No' }}

245 |

Form is valid: {{ myOtherForm.$invalid? 'No' : 'Yes' }}

246 |
247 |
248 | 249 |

Disable combo boxes

250 | 251 |

Disable all

252 | 253 |
254 |

Choose a date:

255 |

Disable combo boxes

256 |
257 | 258 |

Disable one by one

259 | 260 |
261 |

Choose a date:

262 |

Disable date

263 |

Disable month

264 |

Disable year

265 |
266 | 267 |
268 | 269 | 270 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Mozilla Public License Version 2.0 2 | ================================== 3 | 4 | 1. Definitions 5 | -------------- 6 | 7 | 1.1. "Contributor" 8 | means each individual or legal entity that creates, contributes to 9 | the creation of, or owns Covered Software. 10 | 11 | 1.2. "Contributor Version" 12 | means the combination of the Contributions of others (if any) used 13 | by a Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | means Covered Software of a particular Contributor. 17 | 18 | 1.4. "Covered Software" 19 | means Source Code Form to which the initial Contributor has attached 20 | the notice in Exhibit A, the Executable Form of such Source Code 21 | Form, and Modifications of such Source Code Form, in each case 22 | including portions thereof. 23 | 24 | 1.5. "Incompatible With Secondary Licenses" 25 | means 26 | 27 | (a) that the initial Contributor has attached the notice described 28 | in Exhibit B to the Covered Software; or 29 | 30 | (b) that the Covered Software was made available under the terms of 31 | version 1.1 or earlier of the License, but not also under the 32 | terms of a Secondary License. 33 | 34 | 1.6. "Executable Form" 35 | means any form of the work other than Source Code Form. 36 | 37 | 1.7. "Larger Work" 38 | means a work that combines Covered Software with other material, in 39 | a separate file or files, that is not Covered Software. 40 | 41 | 1.8. "License" 42 | means this document. 43 | 44 | 1.9. "Licensable" 45 | means having the right to grant, to the maximum extent possible, 46 | whether at the time of the initial grant or subsequently, any and 47 | all of the rights conveyed by this License. 48 | 49 | 1.10. "Modifications" 50 | means any of the following: 51 | 52 | (a) any file in Source Code Form that results from an addition to, 53 | deletion from, or modification of the contents of Covered 54 | Software; or 55 | 56 | (b) any new file in Source Code Form that contains any Covered 57 | Software. 58 | 59 | 1.11. "Patent Claims" of a Contributor 60 | means any patent claim(s), including without limitation, method, 61 | process, and apparatus claims, in any patent Licensable by such 62 | Contributor that would be infringed, but for the grant of the 63 | License, by the making, using, selling, offering for sale, having 64 | made, import, or transfer of either its Contributions or its 65 | Contributor Version. 66 | 67 | 1.12. "Secondary License" 68 | means either the GNU General Public License, Version 2.0, the GNU 69 | Lesser General Public License, Version 2.1, the GNU Affero General 70 | Public License, Version 3.0, or any later versions of those 71 | licenses. 72 | 73 | 1.13. "Source Code Form" 74 | means the form of the work preferred for making modifications. 75 | 76 | 1.14. "You" (or "Your") 77 | means an individual or a legal entity exercising rights under this 78 | License. For legal entities, "You" includes any entity that 79 | controls, is controlled by, or is under common control with You. For 80 | purposes of this definition, "control" means (a) the power, direct 81 | or indirect, to cause the direction or management of such entity, 82 | whether by contract or otherwise, or (b) ownership of more than 83 | fifty percent (50%) of the outstanding shares or beneficial 84 | ownership of such entity. 85 | 86 | 2. License Grants and Conditions 87 | -------------------------------- 88 | 89 | 2.1. Grants 90 | 91 | Each Contributor hereby grants You a world-wide, royalty-free, 92 | non-exclusive license: 93 | 94 | (a) under intellectual property rights (other than patent or trademark) 95 | Licensable by such Contributor to use, reproduce, make available, 96 | modify, display, perform, distribute, and otherwise exploit its 97 | Contributions, either on an unmodified basis, with Modifications, or 98 | as part of a Larger Work; and 99 | 100 | (b) under Patent Claims of such Contributor to make, use, sell, offer 101 | for sale, have made, import, and otherwise transfer either its 102 | Contributions or its Contributor Version. 103 | 104 | 2.2. Effective Date 105 | 106 | The licenses granted in Section 2.1 with respect to any Contribution 107 | become effective for each Contribution on the date the Contributor first 108 | distributes such Contribution. 109 | 110 | 2.3. Limitations on Grant Scope 111 | 112 | The licenses granted in this Section 2 are the only rights granted under 113 | this License. No additional rights or licenses will be implied from the 114 | distribution or licensing of Covered Software under this License. 115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 116 | Contributor: 117 | 118 | (a) for any code that a Contributor has removed from Covered Software; 119 | or 120 | 121 | (b) for infringements caused by: (i) Your and any other third party's 122 | modifications of Covered Software, or (ii) the combination of its 123 | Contributions with other software (except as part of its Contributor 124 | Version); or 125 | 126 | (c) under Patent Claims infringed by Covered Software in the absence of 127 | its Contributions. 128 | 129 | This License does not grant any rights in the trademarks, service marks, 130 | or logos of any Contributor (except as may be necessary to comply with 131 | the notice requirements in Section 3.4). 132 | 133 | 2.4. Subsequent Licenses 134 | 135 | No Contributor makes additional grants as a result of Your choice to 136 | distribute the Covered Software under a subsequent version of this 137 | License (see Section 10.2) or under the terms of a Secondary License (if 138 | permitted under the terms of Section 3.3). 139 | 140 | 2.5. Representation 141 | 142 | Each Contributor represents that the Contributor believes its 143 | Contributions are its original creation(s) or it has sufficient rights 144 | to grant the rights to its Contributions conveyed by this License. 145 | 146 | 2.6. Fair Use 147 | 148 | This License is not intended to limit any rights You have under 149 | applicable copyright doctrines of fair use, fair dealing, or other 150 | equivalents. 151 | 152 | 2.7. Conditions 153 | 154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 155 | in Section 2.1. 156 | 157 | 3. Responsibilities 158 | ------------------- 159 | 160 | 3.1. Distribution of Source Form 161 | 162 | All distribution of Covered Software in Source Code Form, including any 163 | Modifications that You create or to which You contribute, must be under 164 | the terms of this License. You must inform recipients that the Source 165 | Code Form of the Covered Software is governed by the terms of this 166 | License, and how they can obtain a copy of this License. You may not 167 | attempt to alter or restrict the recipients' rights in the Source Code 168 | Form. 169 | 170 | 3.2. Distribution of Executable Form 171 | 172 | If You distribute Covered Software in Executable Form then: 173 | 174 | (a) such Covered Software must also be made available in Source Code 175 | Form, as described in Section 3.1, and You must inform recipients of 176 | the Executable Form how they can obtain a copy of such Source Code 177 | Form by reasonable means in a timely manner, at a charge no more 178 | than the cost of distribution to the recipient; and 179 | 180 | (b) You may distribute such Executable Form under the terms of this 181 | License, or sublicense it under different terms, provided that the 182 | license for the Executable Form does not attempt to limit or alter 183 | the recipients' rights in the Source Code Form under this License. 184 | 185 | 3.3. Distribution of a Larger Work 186 | 187 | You may create and distribute a Larger Work under terms of Your choice, 188 | provided that You also comply with the requirements of this License for 189 | the Covered Software. If the Larger Work is a combination of Covered 190 | Software with a work governed by one or more Secondary Licenses, and the 191 | Covered Software is not Incompatible With Secondary Licenses, this 192 | License permits You to additionally distribute such Covered Software 193 | under the terms of such Secondary License(s), so that the recipient of 194 | the Larger Work may, at their option, further distribute the Covered 195 | Software under the terms of either this License or such Secondary 196 | License(s). 197 | 198 | 3.4. Notices 199 | 200 | You may not remove or alter the substance of any license notices 201 | (including copyright notices, patent notices, disclaimers of warranty, 202 | or limitations of liability) contained within the Source Code Form of 203 | the Covered Software, except that You may alter any license notices to 204 | the extent required to remedy known factual inaccuracies. 205 | 206 | 3.5. Application of Additional Terms 207 | 208 | You may choose to offer, and to charge a fee for, warranty, support, 209 | indemnity or liability obligations to one or more recipients of Covered 210 | Software. However, You may do so only on Your own behalf, and not on 211 | behalf of any Contributor. You must make it absolutely clear that any 212 | such warranty, support, indemnity, or liability obligation is offered by 213 | You alone, and You hereby agree to indemnify every Contributor for any 214 | liability incurred by such Contributor as a result of warranty, support, 215 | indemnity or liability terms You offer. You may include additional 216 | disclaimers of warranty and limitations of liability specific to any 217 | jurisdiction. 218 | 219 | 4. Inability to Comply Due to Statute or Regulation 220 | --------------------------------------------------- 221 | 222 | If it is impossible for You to comply with any of the terms of this 223 | License with respect to some or all of the Covered Software due to 224 | statute, judicial order, or regulation then You must: (a) comply with 225 | the terms of this License to the maximum extent possible; and (b) 226 | describe the limitations and the code they affect. Such description must 227 | be placed in a text file included with all distributions of the Covered 228 | Software under this License. Except to the extent prohibited by statute 229 | or regulation, such description must be sufficiently detailed for a 230 | recipient of ordinary skill to be able to understand it. 231 | 232 | 5. Termination 233 | -------------- 234 | 235 | 5.1. The rights granted under this License will terminate automatically 236 | if You fail to comply with any of its terms. However, if You become 237 | compliant, then the rights granted under this License from a particular 238 | Contributor are reinstated (a) provisionally, unless and until such 239 | Contributor explicitly and finally terminates Your grants, and (b) on an 240 | ongoing basis, if such Contributor fails to notify You of the 241 | non-compliance by some reasonable means prior to 60 days after You have 242 | come back into compliance. Moreover, Your grants from a particular 243 | Contributor are reinstated on an ongoing basis if such Contributor 244 | notifies You of the non-compliance by some reasonable means, this is the 245 | first time You have received notice of non-compliance with this License 246 | from such Contributor, and You become compliant prior to 30 days after 247 | Your receipt of the notice. 248 | 249 | 5.2. If You initiate litigation against any entity by asserting a patent 250 | infringement claim (excluding declaratory judgment actions, 251 | counter-claims, and cross-claims) alleging that a Contributor Version 252 | directly or indirectly infringes any patent, then the rights granted to 253 | You by any and all Contributors for the Covered Software under Section 254 | 2.1 of this License shall terminate. 255 | 256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 257 | end user license agreements (excluding distributors and resellers) which 258 | have been validly granted by You or Your distributors under this License 259 | prior to termination shall survive termination. 260 | 261 | ************************************************************************ 262 | * * 263 | * 6. Disclaimer of Warranty * 264 | * ------------------------- * 265 | * * 266 | * Covered Software is provided under this License on an "as is" * 267 | * basis, without warranty of any kind, either expressed, implied, or * 268 | * statutory, including, without limitation, warranties that the * 269 | * Covered Software is free of defects, merchantable, fit for a * 270 | * particular purpose or non-infringing. The entire risk as to the * 271 | * quality and performance of the Covered Software is with You. * 272 | * Should any Covered Software prove defective in any respect, You * 273 | * (not any Contributor) assume the cost of any necessary servicing, * 274 | * repair, or correction. This disclaimer of warranty constitutes an * 275 | * essential part of this License. No use of any Covered Software is * 276 | * authorized under this License except under this disclaimer. * 277 | * * 278 | ************************************************************************ 279 | 280 | ************************************************************************ 281 | * * 282 | * 7. Limitation of Liability * 283 | * -------------------------- * 284 | * * 285 | * Under no circumstances and under no legal theory, whether tort * 286 | * (including negligence), contract, or otherwise, shall any * 287 | * Contributor, or anyone who distributes Covered Software as * 288 | * permitted above, be liable to You for any direct, indirect, * 289 | * special, incidental, or consequential damages of any character * 290 | * including, without limitation, damages for lost profits, loss of * 291 | * goodwill, work stoppage, computer failure or malfunction, or any * 292 | * and all other commercial damages or losses, even if such party * 293 | * shall have been informed of the possibility of such damages. This * 294 | * limitation of liability shall not apply to liability for death or * 295 | * personal injury resulting from such party's negligence to the * 296 | * extent applicable law prohibits such limitation. Some * 297 | * jurisdictions do not allow the exclusion or limitation of * 298 | * incidental or consequential damages, so this exclusion and * 299 | * limitation may not apply to You. * 300 | * * 301 | ************************************************************************ 302 | 303 | 8. Litigation 304 | ------------- 305 | 306 | Any litigation relating to this License may be brought only in the 307 | courts of a jurisdiction where the defendant maintains its principal 308 | place of business and such litigation shall be governed by laws of that 309 | jurisdiction, without reference to its conflict-of-law provisions. 310 | Nothing in this Section shall prevent a party's ability to bring 311 | cross-claims or counter-claims. 312 | 313 | 9. Miscellaneous 314 | ---------------- 315 | 316 | This License represents the complete agreement concerning the subject 317 | matter hereof. If any provision of this License is held to be 318 | unenforceable, such provision shall be reformed only to the extent 319 | necessary to make it enforceable. Any law or regulation which provides 320 | that the language of a contract shall be construed against the drafter 321 | shall not be used to construe this License against a Contributor. 322 | 323 | 10. Versions of the License 324 | --------------------------- 325 | 326 | 10.1. New Versions 327 | 328 | Mozilla Foundation is the license steward. Except as provided in Section 329 | 10.3, no one other than the license steward has the right to modify or 330 | publish new versions of this License. Each version will be given a 331 | distinguishing version number. 332 | 333 | 10.2. Effect of New Versions 334 | 335 | You may distribute the Covered Software under the terms of the version 336 | of the License under which You originally received the Covered Software, 337 | or under the terms of any subsequent version published by the license 338 | steward. 339 | 340 | 10.3. Modified Versions 341 | 342 | If you create software not governed by this License, and you want to 343 | create a new license for such software, you may create and use a 344 | modified version of this License if you rename the license and remove 345 | any references to the name of the license steward (except to note that 346 | such modified license differs from this License). 347 | 348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 349 | Licenses 350 | 351 | If You choose to distribute Source Code Form that is Incompatible With 352 | Secondary Licenses under the terms of this version of the License, the 353 | notice described in Exhibit B of this License must be attached. 354 | 355 | Exhibit A - Source Code Form License Notice 356 | ------------------------------------------- 357 | 358 | This Source Code Form is subject to the terms of the Mozilla Public 359 | License, v. 2.0. If a copy of the MPL was not distributed with this 360 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 361 | 362 | If it is not possible or desirable to put the notice in a particular 363 | file, then You may include the notice in a location (such as a LICENSE 364 | file in a relevant directory) where a recipient would be likely to look 365 | for such a notice. 366 | 367 | You may add additional accurate notices of copyright ownership. 368 | 369 | Exhibit B - "Incompatible With Secondary Licenses" Notice 370 | --------------------------------------------------------- 371 | 372 | This Source Code Form is "Incompatible With Secondary Licenses", as 373 | defined by the Mozilla Public License, v. 2.0. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-combo-date-picker", 3 | "version": "1.5.1", 4 | "description": "An Angular directive to select dates using combo boxes", 5 | "main": "source/ngComboDatePicker.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "minify": "node scripts/minify.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/jfmdev/ngComboDatePicker" 13 | }, 14 | "keywords": [ 15 | "angular", 16 | "directive", 17 | "calendar", 18 | "date", 19 | "date", 20 | "picker", 21 | "combobox" 22 | ], 23 | "author": "JFMDev (http://jfmdev.github.io/)", 24 | "license": "MPL-2.0", 25 | "bugs": { 26 | "url": "https://github.com/jfmdev/ngComboDatePicker/issues" 27 | }, 28 | "homepage": "http://jfmdev.github.io/ngComboDatePicker/", 29 | "devDependencies": { 30 | "uglify-save-license": "^0.4.1", 31 | "uglify-js": "^2.4.10" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | > **Notice:** this project has been archived due to AngularJS reaching end of life. 2 | 3 | ngComboDatePicker 4 | ================= 5 | 6 | _Select dates with combo boxes_ 7 | 8 | **ngComboDatePicker** is an AngularJS directive to select dates using combo boxes. 9 | 10 | [See the live demos and read the docs](http://jfmdev.github.io/ngComboDatePicker/ "ngComboDatePicker - Live demos and docs") 11 | 12 | > If you use the React library, you should check [reactComboDatePicker](https://github.com/jfmdev/reactComboDatePicker), a fork of this project that uses React instead of Angular. 13 | > And if you use Angular 4+ (current directive works only on Angular 1.x), you should check [ngx-combo-datepicker](https://github.com/katafractari/ngx-combo-datepicker). 14 | 15 | Usage 16 | ----- 17 | 18 | In order to use this directive: 19 | 20 | **1)** Include the library (located in the `source` folder of this repository) in the header of your HTML files, after including Angular (v1.4.0 or greater): 21 | 22 | ```html 23 | 24 | 25 | ``` 26 | 27 | > Note that, instead of cloning this repository, you can also get this library usins NPM (`npm install ng-combo-date-picker`) or Bower (`bower install ngComboDatePicker`). 28 | 29 | **2)** Then add `ngComboDatePicker` as a dependency when declaring your Angular's app: 30 | 31 | ```javascript 32 | var app = angular.module('myApp',['ngComboDatePicker']); 33 | ``` 34 | 35 | **3)** Then include the directive in your HTML code. For example: 36 | 37 | ```html 38 | 39 | ``` 40 | 41 | or 42 | 43 | ```html 44 | 45 | ``` 46 | 47 | Attributes 48 | ---------- 49 | 50 | The _ngComboDatePicker_ directive supports the following attributes: 51 | 52 | Name | Description 53 | ------------- | ---- 54 | `ngModel` | (mandatory) A _Date_ object in which the picked date is going to be stored. This attribute can also be used to define the initial value of the picker. 55 | `ngDate` | A _string_ representing the initial date of the picker. Note that this value is read only once, when loading the component, so if you plan to change this value dynamically, then you should use the attribute `ngModel` instead. 56 | `ngMinDate` | A _string_ representing the minimum date that can be picked. By default the minimum date is 100 years before the current date. Note that this value is read only once, when loading the component, so if you plan to change this value dynamically, then you should use the attribute `ngMinModel` instead. 57 | `ngMaxDate` | A _string_ representing the maximum date that can be picked. By default the maximum date is the current date. Note that this value is read only once, when loading the component, so if you plan to change this value dynamically, then you should use the attribute `ngMaxModel` instead. 58 | `ngMinModel` | A _Date_ object indicating the minimum date that can be picked. By default the minimum date is 100 years before the current date. 59 | `ngMaxModel` | A _Date_ object indicating the maximum date that can be picked. By default the maximum date is the current date. 60 | `ngTimezone` | A _number_ indicating the timezone to be used when converting a string or an integer to a date. By default the timezone of the client is used. 61 | `ngMonths` | A _string_ with the names of the twelve months, separated by comma. 62 | `ngOrder` | A _string_ with the characters "d", "m" and "y" indicating in which order the combo boxes must be displayed. By default, the combo boxes are displayed in the order "dmy". 63 | `ngAttrsDate` | A _JSON_ object with the attributes (such as `class` or `style`) to add to the `select` element for the date. 64 | `ngAttrsMonth` | A _JSON_ object with the attributes (such as `class` or `style`) to add to the `select` element for the month. 65 | `ngAttrsYear` | A _JSON_ object with the attributes (such as `class` or `style`) to add to the `select` element for the year. 66 | `ngDisabled` | A _boolean_, or an _array_ of three booleans, indicating if the combo boxes should be rendered as disabled. 67 | `ngYearOrder` | A _string_ indicating if the years must be sorted in "ascending" or "descending" order. 68 | `ngPlaceholder` | A _string_ with the placeholders for the year, month and date combo boxes (in that order), separated by comma. 69 | `ngPlaceholderEnabled` | A _boolean_ that allows to enable or disable the placeholder at runtime. 70 | `ngRequired` | A _boolean_ indicating if the component should be considered invalid if any of his combo boxes is empty. 71 | 72 | License 73 | ------- 74 | 75 | ngComboDatePicker is free software; you can redistribute it and/or 76 | modify it under the terms of the Mozilla Public 77 | License v2.0. You should have received a copy of the MPL 2.0 along with this library, otherwise you can obtain one at . 78 | -------------------------------------------------------------------------------- /scripts/minify.js: -------------------------------------------------------------------------------- 1 | // Load dependencies. 2 | const fs = require('fs'); 3 | const UglifyJS = require('uglify-js'); 4 | const SaveLicense = require('uglify-save-license'); 5 | 6 | // Minify code. 7 | let minified_code = UglifyJS.minify('source/ngComboDatePicker.js', { 8 | output: { 9 | comments: SaveLicense 10 | } 11 | }).code; 12 | 13 | // Save result. 14 | fs.writeFile('source/ngComboDatePicker.min.js', minified_code, function(err) { 15 | if(err) { 16 | return console.log(err); 17 | } 18 | 19 | console.log("The file was generated!"); 20 | }); 21 | -------------------------------------------------------------------------------- /source/ngComboDatePicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ngComboDatePicker v1.5.1 3 | * http://github.com/jfmdev/ngComboDatePicker 4 | * «Copyright 2015 Jose F. Maldonado» 5 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | */ 7 | 8 | // Declare module. 9 | angular.module("ngComboDatePicker", []) 10 | 11 | // Declare directive. 12 | .directive('ngComboDatePicker', function() { 13 | // Define fuction for getting the maximum date for a month. 14 | function maxDate(month, year) { 15 | var res = 31; 16 | if(month != null) { 17 | if(month == 4 || month == 6 || month == 9 || month == 11) { 18 | res = 30; 19 | } 20 | if(year != null && month == 2) { 21 | res = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)? 29 : 28; 22 | } 23 | } 24 | return res; 25 | } 26 | 27 | // Define function for adjust timezone. 28 | function adjustTimezone (myDate, myTimezone) { 29 | var offset = isNaN(myTimezone)? new Date().getTimezoneOffset() : parseFloat(myTimezone)*60; 30 | return new Date(myDate.getTime() + offset*60*1000); 31 | } 32 | 33 | // Define function for parse dates. 34 | function parseDate(myDate, myTimezone) { 35 | var res = null; 36 | if(myDate !== undefined && myDate !== null) { 37 | if(myDate instanceof Date) { 38 | res = myDate; 39 | } else { 40 | if(typeof myDate == 'number' || typeof myDate == 'string') { 41 | // Parse date. 42 | res = new Date(isNaN(myDate)? myDate : parseInt(myDate, 10)); 43 | 44 | // Adjust timezone. 45 | res = adjustTimezone(res, myTimezone); 46 | } 47 | } 48 | } 49 | return res; 50 | }; 51 | 52 | // Function to parse an string returning either a number or 'null' (instead of NaN). 53 | function parseIntStrict(num) { 54 | return (num !== null && num !== '' && parseInt(num) != NaN)? parseInt(num) : null; 55 | }; 56 | 57 | // Function to parse a JSON object. 58 | function parseJsonPlus(jsonObj) { 59 | var res = null; 60 | if(jsonObj != null) { 61 | try{ res = JSON.parse(jsonObj); }catch(ex) {} 62 | if(res == null) try{ res = JSON.parse(jsonObj.replace(/'/g, '"')); }catch(ex) {} 63 | } 64 | return res; 65 | } 66 | 67 | // Create directive. 68 | return { 69 | restrict: 'AEC', 70 | scope: { 71 | ngModel: '=', 72 | ngDate : '@', 73 | ngMinDate : '@', 74 | ngMaxDate : '@', 75 | ngMinModel : '=?', 76 | ngMaxModel : '=?', 77 | ngMonths : '@', 78 | ngTimezone: '@', 79 | ngOrder: '@', 80 | ngAttrsDate: '@', 81 | ngAttrsMonth: '@', 82 | ngAttrsYear: '@', 83 | ngDisabled: '=?', 84 | ngYearOrder: '@', 85 | ngPlaceholder: '@', 86 | ngPlaceholderEnabled: '@', 87 | ngRequired: '@' 88 | }, 89 | require: 'ngModel', 90 | controller: ['$scope', function($scope) { 91 | // Initialize models. 92 | $scope.ngModel = parseDate($scope.ngModel, $scope.ngTimezone); 93 | $scope.ngMinModel = parseDate($scope.ngMinModel, $scope.ngTimezone); 94 | $scope.ngMaxModel = parseDate($scope.ngMaxModel, $scope.ngTimezone); 95 | 96 | // Initialize attributes variables. 97 | $scope.ngAttrsDate = parseJsonPlus($scope.ngAttrsDate); 98 | $scope.ngAttrsMonth = parseJsonPlus($scope.ngAttrsMonth); 99 | $scope.ngAttrsYear = parseJsonPlus($scope.ngAttrsYear); 100 | 101 | // Verify if initial date was defined. 102 | var initDate = parseDate($scope.ngDate, $scope.ngTimezone); 103 | if(initDate != null) $scope.ngModel = initDate; 104 | 105 | // Initialize order. 106 | if(typeof $scope.ngOrder != 'string') { 107 | $scope.ngOrder = 'dmy'; 108 | } else { 109 | $scope.ngOrder = $scope.ngOrder.toLowerCase(); 110 | } 111 | 112 | // Initialize minimal and maximum values. 113 | if($scope.ngMinDate) { 114 | $scope.ngMinModel = parseDate($scope.ngMinDate, $scope.ngTimezone); 115 | } 116 | if(!$scope.ngMinModel) { 117 | var now = new Date(); 118 | $scope.ngMinModel = new Date(now.getFullYear()-100, now.getMonth(), now.getDate(), 119 | now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds()); 120 | } 121 | if($scope.ngMaxDate) { 122 | $scope.ngMaxModel = parseDate($scope.ngMaxDate, $scope.ngTimezone); 123 | } 124 | if(!$scope.ngMaxModel) { 125 | $scope.ngMaxModel = new Date(); 126 | } 127 | 128 | // Watch for changes in the minimum and maximum dates. 129 | $scope.$watch('[ngMinModel, ngMaxModel]', function() { 130 | // Update list of years (if possible). 131 | if($scope.ngMinModel && $scope.ngMaxModel) { 132 | // Get list of years. 133 | $scope.years = []; 134 | for(var i=$scope.ngMinModel.getFullYear(); i<=$scope.ngMaxModel.getFullYear(); i++) { 135 | $scope.years.push({value:i, name:i}); 136 | } 137 | 138 | // Verify if the order of the years must be reversed. 139 | if(typeof $scope.ngYearOrder == 'string' && $scope.ngYearOrder.indexOf('des') == 0) { 140 | $scope.years.reverse(); 141 | } 142 | 143 | // Prepend the years placeholder 144 | if($scope.placeHolders) $scope.years.unshift($scope.placeHolders[0]); 145 | } 146 | 147 | // Verify if selected date is in the valid range. 148 | if($scope.ngModel && $scope.ngMinModel && $scope.ngModel < $scope.ngMinModel) $scope.ngModel = $scope.ngMinModel; 149 | if($scope.ngModel && $scope.ngMaxModel && $scope.ngModel > $scope.ngMaxModel) $scope.ngModel = $scope.ngMaxModel; 150 | }); 151 | 152 | // Initialize place holders. 153 | $scope.placeHolders = null; 154 | if($scope.ngPlaceholder !== undefined && $scope.ngPlaceholder !== null && (typeof $scope.ngPlaceholder == 'string' || Array.isArray($scope.ngPlaceholder))) { 155 | var holders = typeof $scope.ngPlaceholder == 'string'? $scope.ngPlaceholder.split(',') : $scope.ngPlaceholder; 156 | if(holders.length == 3) { 157 | $scope.placeHolders = []; 158 | for(var h=0; h maxDay? maxDay : viewValue.date, hours, minutes, seconds, milliseconds); 304 | } 305 | 306 | // Disable placeholders after selecting a value. 307 | if(scope.placeHolders && angular.isUndefined(scope.ngPlaceholderEnabled)) { 308 | if(scope.year != '') scope.placeHolders[0].disabled = true; 309 | if(scope.month != '') scope.placeHolders[1].disabled = true; 310 | if(scope.date != '') scope.placeHolders[2].disabled = true; 311 | } 312 | 313 | // Hide or show days and months according to the min and max dates. 314 | scope.updateMonthList(viewValue.year); 315 | scope.updateDateList(viewValue.month, viewValue.year); 316 | 317 | return res; 318 | }); 319 | 320 | // Method called when one of the combo boxes is touched. 321 | scope.touched = function() { 322 | ngModelCtrl.$touched = true; 323 | ngModelCtrl.$untouched = false; 324 | }; 325 | }, 326 | template: function(element, attrs) { 327 | // Verify if addtional attributes were defined. 328 | var strAttrs = ['', '', '']; 329 | var attrNames = ['ngAttrsDate', 'ngAttrsMonth', 'ngAttrsYear']; 330 | for(var i=0; i<3; i++) { 331 | try{ 332 | // Verify if the attributes were defined. 333 | if(attrs && attrs[attrNames[i]]) { 334 | // Iterate over each attribute. 335 | eval("var attrsAux= " + attrs[attrNames[i]]); 336 | for(var key in attrsAux) { 337 | var value = attrsAux[key]; 338 | if(typeof value == "boolean") { 339 | if(value) strAttrs[i] += key + ' '; 340 | } else { 341 | if(typeof value == "string" && value.indexOf('"') > 0) { value = value.replace(/"/g, '"'); } 342 | strAttrs[i] += key + '="' + value + '" '; 343 | } 344 | } 345 | } 346 | }catch(err){console.log(err);} 347 | } 348 | 349 | // Generate HTML code. 350 | var html = 351 | '' + 352 | '' + 353 | '' 354 | ; 355 | 356 | return html; 357 | } 358 | } 359 | }); 360 | -------------------------------------------------------------------------------- /source/ngComboDatePicker.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ngComboDatePicker v1.5.1 3 | * http://github.com/jfmdev/ngComboDatePicker 4 | * «Copyright 2015 Jose F. Maldonado» 5 | * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | */ 7 | angular.module("ngComboDatePicker",[]).directive("ngComboDatePicker",function(){function maxDate(e,n){var t=31;return null!=e&&(4!=e&&6!=e&&9!=e&&11!=e||(t=30),null!=n&&2==e&&(t=n%4==0&&n%100!=0||n%400==0?29:28)),t}function adjustTimezone(e,n){var t=isNaN(n)?(new Date).getTimezoneOffset():60*parseFloat(n);return new Date(e.getTime()+60*t*1e3)}function parseDate(e,n){var t=null;return void 0!==e&&null!==e&&(e instanceof Date?t=e:"number"!=typeof e&&"string"!=typeof e||(t=new Date(isNaN(e)?e:parseInt(e,10)),t=adjustTimezone(t,n))),t}function parseIntStrict(e){return null!==e&&""!==e&&NaN!=parseInt(e)?parseInt(e):null}function parseJsonPlus(e){var n=null;if(null!=e){try{n=JSON.parse(e)}catch(e){}if(null==n)try{n=JSON.parse(e.replace(/'/g,'"'))}catch(e){}}return n}return{restrict:"AEC",scope:{ngModel:"=",ngDate:"@",ngMinDate:"@",ngMaxDate:"@",ngMinModel:"=?",ngMaxModel:"=?",ngMonths:"@",ngTimezone:"@",ngOrder:"@",ngAttrsDate:"@",ngAttrsMonth:"@",ngAttrsYear:"@",ngDisabled:"=?",ngYearOrder:"@",ngPlaceholder:"@",ngPlaceholderEnabled:"@",ngRequired:"@"},require:"ngModel",controller:["$scope",function(e){e.ngModel=parseDate(e.ngModel,e.ngTimezone),e.ngMinModel=parseDate(e.ngMinModel,e.ngTimezone),e.ngMaxModel=parseDate(e.ngMaxModel,e.ngTimezone),e.ngAttrsDate=parseJsonPlus(e.ngAttrsDate),e.ngAttrsMonth=parseJsonPlus(e.ngAttrsMonth),e.ngAttrsYear=parseJsonPlus(e.ngAttrsYear);var n=parseDate(e.ngDate,e.ngTimezone);if(null!=n&&(e.ngModel=n),"string"!=typeof e.ngOrder?e.ngOrder="dmy":e.ngOrder=e.ngOrder.toLowerCase(),e.ngMinDate&&(e.ngMinModel=parseDate(e.ngMinDate,e.ngTimezone)),!e.ngMinModel){var t=new Date;e.ngMinModel=new Date(t.getFullYear()-100,t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}if(e.ngMaxDate&&(e.ngMaxModel=parseDate(e.ngMaxDate,e.ngTimezone)),e.ngMaxModel||(e.ngMaxModel=new Date),e.$watch("[ngMinModel, ngMaxModel]",function(){if(e.ngMinModel&&e.ngMaxModel){e.years=[];for(var n=e.ngMinModel.getFullYear();n<=e.ngMaxModel.getFullYear();n++)e.years.push({value:n,name:n});"string"==typeof e.ngYearOrder&&0==e.ngYearOrder.indexOf("des")&&e.years.reverse(),e.placeHolders&&e.years.unshift(e.placeHolders[0])}e.ngModel&&e.ngMinModel&&e.ngModele.ngMaxModel&&(e.ngModel=e.ngMaxModel)}),e.placeHolders=null,void 0!==e.ngPlaceholder&&null!==e.ngPlaceholder&&("string"==typeof e.ngPlaceholder||Array.isArray(e.ngPlaceholder))){var a="string"==typeof e.ngPlaceholder?e.ngPlaceholder.split(","):e.ngPlaceholder;if(3==a.length){e.placeHolders=[];for(var l=0;la?a:n.date,l,r,o,s)}return e.placeHolders&&angular.isUndefined(e.ngPlaceholderEnabled)&&(""!=e.year&&(e.placeHolders[0].disabled=!0),""!=e.month&&(e.placeHolders[1].disabled=!0),""!=e.date&&(e.placeHolders[2].disabled=!0)),e.updateMonthList(n.year),e.updateDateList(n.month,n.year),t}),e.touched=function(){a.$touched=!0,a.$untouched=!1}},template:function(element,attrs){for(var strAttrs=["","",""],attrNames=["ngAttrsDate","ngAttrsMonth","ngAttrsYear"],i=0;i<3;i++)try{if(attrs&&attrs[attrNames[i]]){eval("var attrsAux= "+attrs[attrNames[i]]);for(var key in attrsAux){var value=attrsAux[key];"boolean"==typeof value?value&&(strAttrs[i]+=key+" "):("string"==typeof value&&value.indexOf('"')>0&&(value=value.replace(/"/g,""")),strAttrs[i]+=key+'="'+value+'" ')}}}catch(e){console.log(e)}var html='';return html}}}); --------------------------------------------------------------------------------