From 3b50ba40c61c65e47d55e9ee0dc2f096ca3f8e32 Mon Sep 17 00:00:00 2001 From: Oleg Konyk Date: Tue, 13 Oct 2015 18:42:06 -0700 Subject: [PATCH 1/2] Removed lodash dependancy --- dist/angular-datepicker.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/angular-datepicker.js b/dist/angular-datepicker.js index 98cfa26..decfa43 100644 --- a/dist/angular-datepicker.js +++ b/dist/angular-datepicker.js @@ -25,7 +25,7 @@ Module.filter('time',function () { }; }); -Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', 'lodash', function datePickerDirective(datePickerConfig, datePickerUtils, _) { +Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', function datePickerDirective(datePickerConfig, datePickerUtils) { //noinspection JSUnusedLocalSymbols return { @@ -47,7 +47,10 @@ Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', 'lodash', scope.now = new Date(); scope.template = attrs.template || datePickerConfig.template; scope.watchDirectChanges = attrs.watchDirectChanges !== undefined; - scope.callbackOnSetDate = attrs.onSetDate ? _.get(scope.$parent, attrs.onSetDate) : undefined; + if(scope.callbackOnSetDate){ + element.attr('onSetDate', undefined); + } + var step = parseInt(attrs.step || datePickerConfig.step, 10); var partial = !!attrs.partial; From cc41570420855d51da6a6e8cd7ea0d32f0b0f46d Mon Sep 17 00:00:00 2001 From: Oleg Konyk Date: Wed, 14 Oct 2015 08:28:08 -0700 Subject: [PATCH 2/2] Removed lodash dependancy, callback functionality preserved --- app/scripts/datePicker.js | 8 ++++++-- bower.json | 8 +++----- dist/angular-datepicker.js | 6 ++++-- dist/angular-datepicker.min.js | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/scripts/datePicker.js b/app/scripts/datePicker.js index bc4ce41..7e1c757 100644 --- a/app/scripts/datePicker.js +++ b/app/scripts/datePicker.js @@ -25,7 +25,7 @@ Module.filter('time',function () { }; }); -Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', 'lodash', function datePickerDirective(datePickerConfig, datePickerUtils, _) { +Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', function datePickerDirective(datePickerConfig, datePickerUtils) { //noinspection JSUnusedLocalSymbols return { @@ -47,7 +47,11 @@ Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', 'lodash', scope.now = new Date(); scope.template = attrs.template || datePickerConfig.template; scope.watchDirectChanges = attrs.watchDirectChanges !== undefined; - scope.callbackOnSetDate = attrs.onSetDate ? _.get(scope.$parent, attrs.onSetDate) : undefined; + if(attrs.onSetDate){ + scope.callbackOnSetDate = scope.$parent[attrs.onSetDate] + }else{ + scope.callbackOnSetDate = undefined; + } var step = parseInt(attrs.step || datePickerConfig.step, 10); var partial = !!attrs.partial; diff --git a/bower.json b/bower.json index e8d45b4..58b7393 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-datepicker", "license": "MIT", - "version": "1.0.18", + "version": "1.0.20", "main": [ "./dist/angular-datepicker.js", "./dist/angular-datepicker.css" @@ -21,14 +21,12 @@ "package.json" ], "dependencies": { - "angular": "1.2.14", - "lodash": "~3.10.1" + "angular": "1.2.14" }, "devDependencies": { "angular": "1.2.14", "angular-mocks": "1.2.14", "angular-scenario": "1.2.14", - "angular-bootstrap": "~0.3.0", - "lodash": "~3.10.1" + "angular-bootstrap": "~0.3.0" } } diff --git a/dist/angular-datepicker.js b/dist/angular-datepicker.js index decfa43..7992e9e 100644 --- a/dist/angular-datepicker.js +++ b/dist/angular-datepicker.js @@ -47,8 +47,10 @@ Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', function scope.now = new Date(); scope.template = attrs.template || datePickerConfig.template; scope.watchDirectChanges = attrs.watchDirectChanges !== undefined; - if(scope.callbackOnSetDate){ - element.attr('onSetDate', undefined); + if(attrs.onSetDate){ + scope.callbackOnSetDate = scope.$parent[attrs.onSetDate] + }else{ + scope.callbackOnSetDate = undefined; } diff --git a/dist/angular-datepicker.min.js b/dist/angular-datepicker.min.js index aefa9da..3963885 100644 --- a/dist/angular-datepicker.min.js +++ b/dist/angular-datepicker.min.js @@ -1 +1 @@ -"use strict";!function(a){var b=a.module("datePicker",[]);b.constant("datePickerConfig",{template:"templates/datepicker.html",view:"month",views:["year","month","date","hours","minutes"],step:5}),b.filter("time",function(){function a(a){return("0"+a.getHours()).slice(-2)+":"+("0"+a.getMinutes()).slice(-2)}return function(b){return b instanceof Date||(b=new Date(b),!isNaN(b.getTime()))?a(b):void 0}}),b.directive("datePicker",["datePickerConfig","datePickerUtils","lodash",function(b,c,d){return{require:"?ngModel",template:'
',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(e,f,g,h){function i(){var a=e.view;e.model&&!k&&(e.date=new Date(e.model),k=!1);var b=e.date;switch(a){case"year":e.years=c.getVisibleYears(b);break;case"month":e.months=c.getVisibleMonths(b);break;case"date":e.weekdays=e.weekdays||c.getDaysOfWeek(),e.weeks=c.getVisibleWeeks(b);break;case"hours":e.hours=c.getVisibleHours(b);break;case"minutes":e.minutes=c.getVisibleMinutes(b,l)}}function j(){return"date"!==e.view?e.view:e.date?e.date.getMonth():null}var k=!1;e.date=new Date(e.model||new Date),e.views=b.views.concat(),e.view=g.view||b.view,e.now=new Date,e.template=g.template||b.template,e.watchDirectChanges=void 0!==g.watchDirectChanges,e.callbackOnSetDate=g.onSetDate?d.get(e.$parent,g.onSetDate):void 0;var l=parseInt(g.step||b.step,10),m=!!g.partial;if(h){if(a.isDefined(g.minDate)){var n;h.$validators.min=function(b){return!c.isValidDate(b)||a.isUndefined(n)||b>=n},g.$observe("minDate",function(a){n=new Date(a),h.$validate()})}if(a.isDefined(g.maxDate)){var o;h.$validators.max=function(b){return!c.isValidDate(b)||a.isUndefined(o)||o>=b},g.$observe("maxDate",function(a){o=new Date(a),h.$validate()})}}e.views=e.views.slice(e.views.indexOf(g.maxView||"year"),e.views.indexOf(g.minView||"minutes")+1),(1===e.views.length||-1===e.views.indexOf(e.view))&&(e.view=e.views[0]),e.setView=function(a){-1!==e.views.indexOf(a)&&(e.view=a)},e.setDate=function(a){if(!g.disabled){e.date=a;var b=e.views[e.views.indexOf(e.view)+1];if(!b||m||e.model){e.model=new Date(e.model||a),h&&h.$setViewValue(e.date);var c=m?"minutes":e.view;switch(c){case"minutes":e.model.setMinutes(a.getMinutes());case"hours":e.model.setHours(a.getHours());case"date":e.model.setDate(a.getDate());case"month":e.model.setMonth(a.getMonth());case"year":e.model.setFullYear(a.getFullYear())}!b&&e.model&&(e.$emit("setMaxDate",g.datePicker,e.model,e.view),e.callbackOnSetDate&&e.callbackOnSetDate()),e.$emit("setDate",e.model,e.view)}b&&e.setView(b),b||"true"!==g.autoClose||(f.addClass("hidden"),e.$emit("hidePicker"))}},e.$watch(j,i),e.watchDirectChanges&&e.$watch("model",i),e.next=function(a){var b=e.date;switch(a=a||1,e.view){case"year":case"month":b.setFullYear(b.getFullYear()+a);break;case"date":b.setMonth(b.getMonth()+a);break;case"hours":case"minutes":b.setHours(b.getHours()+a)}k=!0,i()},e.prev=function(a){return e.next(-a||-1)},e.isAfter=function(a){return e.after&&c.isAfter(a,e.after)},e.isBefore=function(a){return e.before&&c.isBefore(a,e.before)},e.isSameMonth=function(a){return c.isSameMonth(e.model,a)},e.isSameYear=function(a){return c.isSameYear(e.model,a)},e.isSameDay=function(a){return c.isSameDay(e.model,a)},e.isSameHour=function(a){return c.isSameHour(e.model,a)},e.isSameMinutes=function(a){return c.isSameMinutes(e.model,a)},e.isNow=function(a){var b=!0,c=e.now;switch(e.view){case"minutes":b&=~~(a.getMinutes()/l)===~~(c.getMinutes()/l);case"hours":b&=a.getHours()===c.getHours();case"date":b&=a.getDate()===c.getDate();case"month":b&=a.getMonth()===c.getMonth();case"year":b&=a.getFullYear()===c.getFullYear()}return b}}}}]),a.module("datePicker").factory("datePickerUtils",function(){var a=function(a,b,c,d,e){return new Date(0|a,0|b,0|c,0|d,0|e)};return{getVisibleMinutes:function(b,c){b=new Date(b||new Date);var d,e,f=b.getFullYear(),g=b.getMonth(),h=b.getDate(),i=b.getHours(),j=[];for(d=0;60>d;d+=c)e=a(f,g,h,i,d),j.push(e);return j},getVisibleWeeks:function(a){a=new Date(a||new Date);var b=a.getMonth(),c=a.getYear();a.setDate(1),0===a.getDay()?a.setDate(-5):a.setDate(a.getDate()-(a.getDay()-1)),1===a.getDate()&&a.setDate(-6);for(var d,e=[];e.length<6&&!(a.getYear()===c&&a.getMonth()>b);)d=this.getDaysOfWeek(a),e.push(d),a.setDate(a.getDate()+7);return e},getVisibleYears:function(b){b=new Date(b||new Date),b.setFullYear(b.getFullYear()-b.getFullYear()%10);for(var c,d=b.getFullYear(),e=[],f=0;12>f;f++)c=a(d),e.push(c),d++;return e},getDaysOfWeek:function(b){b=new Date(b||new Date),b.setDate(b.getDate()-(b.getDay()-1));for(var c,d=b.getFullYear(),e=b.getMonth(),f=b.getDate(),g=[],h=0;7>h;h++)c=a(d,e,f),g.push(c),f++;return g},getVisibleMonths:function(b){b=new Date(b||new Date);for(var c,d=b.getFullYear(),e=[],f=0;12>f;f++)c=a(d,f,1),e.push(c);return e},getVisibleHours:function(b){b=new Date(b||new Date);var c,d,e=b.getFullYear(),f=b.getMonth(),g=b.getDate(),h=[];for(c=0;24>c;c++)d=a(e,f,g,c),h.push(d);return h},isAfter:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),a&&a.getTime()>=b.getTime()},isBefore:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),a.getTime()<=b.getTime()},isSameYear:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),a&&a.getFullYear()===b.getFullYear()},isSameMonth:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),this.isSameYear(a,b)&&a.getMonth()===b.getMonth()},isSameDay:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),this.isSameMonth(a,b)&&a.getDate()===b.getDate()},isSameHour:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),this.isSameDay(a,b)&&a.getHours()===b.getHours()},isSameMinutes:function(a,b){return a=void 0!==a?new Date(a):a,b=new Date(b),this.isSameHour(a,b)&&a.getMinutes()===b.getMinutes()},isValidDate:function(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}}});var b=a.module("datePicker");b.directive("dateRange",function(){return{templateUrl:"templates/daterange.html",scope:{start:"=",end:"="},link:function(a,b,c){a.start=new Date(a.start||new Date),a.end=new Date(a.end||new Date),c.$observe("disabled",function(b){a.disableDatePickers=!!b}),a.$watch("start.getTime()",function(b){b&&a.end&&b>a.end.getTime()&&(a.end=new Date(b))}),a.$watch("end.getTime()",function(b){b&&a.start&&b'},format:"yyyy-MM-dd HH:mm",views:["date","year","month","hours","minutes"],autoClose:!1,position:"relative"}),b.directive("dateTimeAppend",function(){return{link:function(a,b){b.bind("click",function(){b.find("input")[0].focus()})}}}),b.directive("dateTime",["$compile","$document","$filter","dateTimeConfig","$parse","datePickerUtils",function(b,e,f,g,h,i){var j=e.find("body"),k=f("date");return{require:"ngModel",scope:!0,link:function(e,f,l,m){function n(a){return k(a,s)}function o(a){return a.length===s.length?a:void 0}function p(a){a.stopPropagation(),m.$pristine&&(m.$dirty=!0,m.$pristine=!1,f.removeClass(c).addClass(d),t&&t.$setDirty(),m.$render())}function q(){y&&(y.remove(),y=null),A&&(A.remove(),A=null)}function r(){if(!y){if(y=b(D)(e),e.$digest(),e.$on("setDate",function(a,b,c){p(a),x&&u[u.length-1]===c&&q()}),e.$on("hidePicker",function(){f.triggerHandler("blur")}),e.$on("$destroy",q),"absolute"===z){var c=a.extend(f.offset(),{height:f[0].offsetHeight});y.css({top:c.top+c.height,left:c.left,display:"block",position:z}),j.append(y)}else A=a.element("
"),f[0].parentElement.insertBefore(A[0],f[0]),A.append(y),y.css({top:f[0].offsetHeight+"px",display:"block"});y.bind("mousedown",function(a){a.preventDefault()})}}var s=l.format||g.format,t=f.inheritedData("$formController"),u=h(l.views)(e)||g.views.concat(),v=l.view||u[0],w=u.indexOf(v),x=l.autoClose?h(l.autoClose)(e):g.autoClose,y=null,z=l.position||g.position,A=null;if(-1===w&&u.splice(w,1),u.unshift(v),m.$formatters.push(n),m.$parsers.unshift(o),a.isDefined(l.minDate)){var B;m.$validators.min=function(b){return!i.isValidDate(b)||a.isUndefined(B)||b>=B},l.$observe("minDate",function(a){B=new Date(a),m.$validate()})}if(a.isDefined(l.maxDate)){var C;m.$validators.max=function(b){return!i.isValidDate(b)||a.isUndefined(C)||C>=b},l.$observe("maxDate",function(a){C=new Date(a),m.$validate()})}var D=g.template(l);f.bind("focus",r),f.bind("blur",q)}}}]),a.module("datePicker").run(["$templateCache",function(a){a.put("templates/datepicker.html",'
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n'),a.put("templates/daterange.html",'
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n')}])}(angular); \ No newline at end of file +"use strict";!function(e){var t=e.module("datePicker",[]);t.constant("datePickerConfig",{template:"templates/datepicker.html",view:"month",views:["year","month","date","hours","minutes"],step:5}),t.filter("time",function(){function e(e){return("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)}return function(t){return t instanceof Date||(t=new Date(t),!isNaN(t.getTime()))?e(t):void 0}}),t.directive("datePicker",["datePickerConfig","datePickerUtils",function(t,n){return{require:"?ngModel",template:'
',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(a,i,r,s){function o(){var e=a.view;a.model&&!l&&(a.date=new Date(a.model),l=!1);var t=a.date;switch(e){case"year":a.years=n.getVisibleYears(t);break;case"month":a.months=n.getVisibleMonths(t);break;case"date":a.weekdays=a.weekdays||n.getDaysOfWeek(),a.weeks=n.getVisibleWeeks(t);break;case"hours":a.hours=n.getVisibleHours(t);break;case"minutes":a.minutes=n.getVisibleMinutes(t,c)}}function d(){return"date"!==a.view?a.view:a.date?a.date.getMonth():null}var l=!1;a.date=new Date(a.model||new Date),a.views=t.views.concat(),a.view=r.view||t.view,a.now=new Date,a.template=r.template||t.template,a.watchDirectChanges=void 0!==r.watchDirectChanges,a.callbackOnSetDate=r.onSetDate?a.$parent[r.onSetDate]:void 0;var c=parseInt(r.step||t.step,10),u=!!r.partial;if(s){if(e.isDefined(r.minDate)){var g;s.$validators.min=function(t){return!n.isValidDate(t)||e.isUndefined(g)||t>=g},r.$observe("minDate",function(e){g=new Date(e),s.$validate()})}if(e.isDefined(r.maxDate)){var m;s.$validators.max=function(t){return!n.isValidDate(t)||e.isUndefined(m)||m>=t},r.$observe("maxDate",function(e){m=new Date(e),s.$validate()})}}a.views=a.views.slice(a.views.indexOf(r.maxView||"year"),a.views.indexOf(r.minView||"minutes")+1),(1===a.views.length||-1===a.views.indexOf(a.view))&&(a.view=a.views[0]),a.setView=function(e){-1!==a.views.indexOf(e)&&(a.view=e)},a.setDate=function(e){if(!r.disabled){a.date=e;var t=a.views[a.views.indexOf(a.view)+1];if(!t||u||a.model){a.model=new Date(a.model||e),s&&s.$setViewValue(a.date);var n=u?"minutes":a.view;switch(n){case"minutes":a.model.setMinutes(e.getMinutes());case"hours":a.model.setHours(e.getHours());case"date":a.model.setDate(e.getDate());case"month":a.model.setMonth(e.getMonth());case"year":a.model.setFullYear(e.getFullYear())}!t&&a.model&&(a.$emit("setMaxDate",r.datePicker,a.model,a.view),a.callbackOnSetDate&&a.callbackOnSetDate()),a.$emit("setDate",a.model,a.view)}t&&a.setView(t),t||"true"!==r.autoClose||(i.addClass("hidden"),a.$emit("hidePicker"))}},a.$watch(d,o),a.watchDirectChanges&&a.$watch("model",o),a.next=function(e){var t=a.date;switch(e=e||1,a.view){case"year":case"month":t.setFullYear(t.getFullYear()+e);break;case"date":t.setMonth(t.getMonth()+e);break;case"hours":case"minutes":t.setHours(t.getHours()+e)}l=!0,o()},a.prev=function(e){return a.next(-e||-1)},a.isAfter=function(e){return a.after&&n.isAfter(e,a.after)},a.isBefore=function(e){return a.before&&n.isBefore(e,a.before)},a.isSameMonth=function(e){return n.isSameMonth(a.model,e)},a.isSameYear=function(e){return n.isSameYear(a.model,e)},a.isSameDay=function(e){return n.isSameDay(a.model,e)},a.isSameHour=function(e){return n.isSameHour(a.model,e)},a.isSameMinutes=function(e){return n.isSameMinutes(a.model,e)},a.isNow=function(e){var t=!0,n=a.now;switch(a.view){case"minutes":t&=~~(e.getMinutes()/c)===~~(n.getMinutes()/c);case"hours":t&=e.getHours()===n.getHours();case"date":t&=e.getDate()===n.getDate();case"month":t&=e.getMonth()===n.getMonth();case"year":t&=e.getFullYear()===n.getFullYear()}return t}}}}]),e.module("datePicker").factory("datePickerUtils",function(){var e=function(e,t,n,a,i){return new Date(0|e,0|t,0|n,0|a,0|i)};return{getVisibleMinutes:function(t,n){t=new Date(t||new Date);var a,i,r=t.getFullYear(),s=t.getMonth(),o=t.getDate(),d=t.getHours(),l=[];for(a=0;60>a;a+=n)i=e(r,s,o,d,a),l.push(i);return l},getVisibleWeeks:function(e){e=new Date(e||new Date);var t=e.getMonth(),n=e.getYear();e.setDate(1),e.setDate(0===e.getDay()?-5:e.getDate()-(e.getDay()-1)),1===e.getDate()&&e.setDate(-6);for(var a,i=[];i.length<6&&!(e.getYear()===n&&e.getMonth()>t);)a=this.getDaysOfWeek(e),i.push(a),e.setDate(e.getDate()+7);return i},getVisibleYears:function(t){t=new Date(t||new Date),t.setFullYear(t.getFullYear()-t.getFullYear()%10);for(var n,a=t.getFullYear(),i=[],r=0;12>r;r++)n=e(a),i.push(n),a++;return i},getDaysOfWeek:function(t){t=new Date(t||new Date),t.setDate(t.getDate()-(t.getDay()-1));for(var n,a=t.getFullYear(),i=t.getMonth(),r=t.getDate(),s=[],o=0;7>o;o++)n=e(a,i,r),s.push(n),r++;return s},getVisibleMonths:function(t){t=new Date(t||new Date);for(var n,a=t.getFullYear(),i=[],r=0;12>r;r++)n=e(a,r,1),i.push(n);return i},getVisibleHours:function(t){t=new Date(t||new Date);var n,a,i=t.getFullYear(),r=t.getMonth(),s=t.getDate(),o=[];for(n=0;24>n;n++)a=e(i,r,s,n),o.push(a);return o},isAfter:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e&&e.getTime()>=t.getTime()},isBefore:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e.getTime()<=t.getTime()},isSameYear:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),e&&e.getFullYear()===t.getFullYear()},isSameMonth:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameYear(e,t)&&e.getMonth()===t.getMonth()},isSameDay:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameMonth(e,t)&&e.getDate()===t.getDate()},isSameHour:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameDay(e,t)&&e.getHours()===t.getHours()},isSameMinutes:function(e,t){return e=void 0!==e?new Date(e):e,t=new Date(t),this.isSameHour(e,t)&&e.getMinutes()===t.getMinutes()},isValidDate:function(e){return e&&!(e.getTime&&e.getTime()!==e.getTime())}}});var t=e.module("datePicker");t.directive("dateRange",function(){return{templateUrl:"templates/daterange.html",scope:{start:"=",end:"="},link:function(e,t,n){e.start=new Date(e.start||new Date),e.end=new Date(e.end||new Date),n.$observe("disabled",function(t){e.disableDatePickers=!!t}),e.$watch("start.getTime()",function(t){t&&e.end&&t>e.end.getTime()&&(e.end=new Date(t))}),e.$watch("end.getTime()",function(t){t&&e.start&&t'},format:"yyyy-MM-dd HH:mm",views:["date","year","month","hours","minutes"],autoClose:!1,position:"relative"}),t.directive("dateTimeAppend",function(){return{link:function(e,t){t.bind("click",function(){t.find("input")[0].focus()})}}}),t.directive("dateTime",["$compile","$document","$filter","dateTimeConfig","$parse","datePickerUtils",function(t,i,r,s,o,d){var l=i.find("body"),c=r("date");return{require:"ngModel",scope:!0,link:function(i,r,u,g){function m(e){return c(e,p)}function h(e){return e.length===p.length?e:void 0}function f(e){e.stopPropagation(),g.$pristine&&(g.$dirty=!0,g.$pristine=!1,r.removeClass(n).addClass(a),D&&D.$setDirty(),g.$render())}function w(){$&&($.remove(),$=null),V&&(V.remove(),V=null)}function v(){if(!$){if($=t(H)(i),i.$digest(),i.$on("setDate",function(e,t,n){f(e),M&&b[b.length-1]===n&&w()}),i.$on("hidePicker",function(){r.triggerHandler("blur")}),i.$on("$destroy",w),"absolute"===S){var n=e.extend(r.offset(),{height:r[0].offsetHeight});$.css({top:n.top+n.height,left:n.left,display:"block",position:S}),l.append($)}else V=e.element("
"),r[0].parentElement.insertBefore(V[0],r[0]),V.append($),$.css({top:r[0].offsetHeight+"px",display:"block"});$.bind("mousedown",function(e){e.preventDefault()})}}var p=u.format||s.format,D=r.inheritedData("$formController"),b=o(u.views)(i)||s.views.concat(),y=u.view||b[0],k=b.indexOf(y),M=u.autoClose?o(u.autoClose)(i):s.autoClose,$=null,S=u.position||s.position,V=null;if(-1===k&&b.splice(k,1),b.unshift(y),g.$formatters.push(m),g.$parsers.unshift(h),e.isDefined(u.minDate)){var x;g.$validators.min=function(t){return!d.isValidDate(t)||e.isUndefined(x)||t>=x},u.$observe("minDate",function(e){x=new Date(e),g.$validate()})}if(e.isDefined(u.maxDate)){var Y;g.$validators.max=function(t){return!d.isValidDate(t)||e.isUndefined(Y)||Y>=t},u.$observe("maxDate",function(e){Y=new Date(e),g.$validate()})}var H=s.template(u);r.bind("focus",v),r.bind("blur",w)}}}]),e.module("datePicker").run(["$templateCache",function(e){e.put("templates/datepicker.html",'
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n'),e.put("templates/daterange.html",'
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n')}])}(angular); \ No newline at end of file