From 791761320f35e724eed747e9614f4ddf2fcc660e Mon Sep 17 00:00:00 2001 From: Emanuel Ralha Date: Tue, 1 Sep 2015 11:08:13 +0100 Subject: [PATCH] Build 1.0.13 --- app/scripts/datePickerUtils.js | 2 +- dist/index.js | 22 +++++++++++++++------- dist/index.min.css | 2 +- dist/index.min.js | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/scripts/datePickerUtils.js b/app/scripts/datePickerUtils.js index bdba2e7..9cc7c6b 100644 --- a/app/scripts/datePickerUtils.js +++ b/app/scripts/datePickerUtils.js @@ -154,6 +154,6 @@ angular.module('datePicker').factory('datePickerUtils', function(){ momentFormat = replaceAll('sss', 'SSS', momentFormat); momentFormat = replaceAll('w', 'W', momentFormat); return momentFormat; - } + } }; }); \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 2a1baa4..dc704ec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,9 +1,11 @@ 'use strict'; (function(angular){ +'use strict'; + var Module = angular.module('datePicker', ['angularMoment']); Module.constant('datePickerConfig', { - template: 'app/templates/datepicker.html', + template: 'templates/datepicker.html', view: 'month', views: ['year', 'month', 'date', 'hours', 'minutes'], step: 5 @@ -265,6 +267,8 @@ Module.directive('datePicker', ['datePickerConfig', 'datePickerUtils', function }; }]); +'use strict'; + angular.module('datePicker').factory('datePickerUtils', function(){ var createNewDate = function(year, month, day, hour, minute) { // without any arguments, the default date will be 1899-12-31T00:00:00.000Z @@ -419,9 +423,11 @@ angular.module('datePicker').factory('datePickerUtils', function(){ momentFormat = replaceAll('sss', 'SSS', momentFormat); momentFormat = replaceAll('w', 'W', momentFormat); return momentFormat; - } + } }; }); +'use strict'; + var Module = angular.module('datePicker'); Module.directive('dateRange', function () { @@ -456,6 +462,8 @@ Module.directive('dateRange', function () { }; }); +'use strict'; + var PRISTINE_CLASS = 'ng-pristine', DIRTY_CLASS = 'ng-dirty'; @@ -635,8 +643,9 @@ Module.directive('dateTime', ['$compile', '$document', '$filter', 'dateTimeConfi }; }]); -angular.module('datePicker').run(['$templateCache', function($templateCache) { -$templateCache.put('app/templates/datepicker.html', +angular.module("datePicker").run(["$templateCache", function($templateCache) { + + $templateCache.put("templates/datepicker.html", "
\r" + "\n" + "
\r" + @@ -853,8 +862,7 @@ $templateCache.put('app/templates/datepicker.html', "\n" ); - - $templateCache.put('app/templates/daterange.html', + $templateCache.put("templates/daterange.html", "
\r" + "\n" + " \r" + @@ -882,4 +890,4 @@ $templateCache.put('app/templates/datepicker.html', ); }]); -})(angular); +})(angular); \ No newline at end of file diff --git a/dist/index.min.css b/dist/index.min.css index ce2cdcf..1d7caba 100644 --- a/dist/index.min.css +++ b/dist/index.min.css @@ -1 +1 @@ -.clearfix:after,.clearfix:before{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}[date-picker],[date-picker] td,[date-picker] th{-webkit-border-radius:4px;-moz-border-radius:4px}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.date-picker-date-time{position:absolute}[date-picker-wrapper]{position:absolute;min-width:220px;z-index:10;display:block;font-size:14px}[date-time-append] [date-picker-wrapper] [date-picker]{margin-top:-30px}[date-time-append] [date-picker]{position:relative;margin-right:-1000px;margin-bottom:-1000px}[date-range] [date-picker] .after.before{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#499dcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f6ab4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f6ab4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f6ab4);background-image:-o-linear-gradient(top,#5bc0de,#2f6ab4);background-image:linear-gradient(to bottom,#5bc0de,#2f6ab4);background-repeat:repeat-x;border-color:#2f6ab4 #2f6ab4 #1f4677;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}[date-range] [date-picker] .after.before.active,[date-range] [date-picker] .after.before.disabled,[date-range] [date-picker] .after.before:active,[date-range] [date-picker] .after.before:hover,[date-range] [date-picker] .after.before[disabled]{color:#fff;background-color:#2f6ab4}[date-range] [date-picker] .after.before.active,[date-range] [date-picker] .after.before:active{background-color:#24528c\9}[date-picker].hidden{display:none}[date-picker]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;border-radius:4px;background-color:#fff;padding:4px}[date-picker] table{margin:0}[date-picker] td,[date-picker] th{padding:4px 5px;text-align:center;width:20px;height:20px;border-radius:4px;border:none}[date-picker] .switch{width:145px}[date-picker] span{display:block;width:23%;height:26px;line-height:25px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}[date-picker] span:hover{background:#eee}[date-picker] span.disabled,[date-picker] span.disabled:hover{background:0 0;color:#999;cursor:default}[date-picker] .active,[date-picker] .now{text-shadow:0 -1px 0 rgba(0,0,0,.25);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);color:#fff}[date-picker] .active.active,[date-picker] .active.disabled,[date-picker] .active:active,[date-picker] .active:hover,[date-picker] .active[disabled],[date-picker] .now.active,[date-picker] .now.disabled,[date-picker] .now:active,[date-picker] .now:hover,[date-picker] .now[disabled]{color:#fff;background-color:#04c}[date-picker] .active.active,[date-picker] .active:active,[date-picker] .now.active,[date-picker] .now:active{background-color:#039\9}[date-picker] .now{color:#fff;background-color:#ee735b;background-image:-moz-linear-gradient(top,#ee5f5b,#ee905b);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#ee905b));background-image:-webkit-linear-gradient(top,#ee5f5b,#ee905b);background-image:-o-linear-gradient(top,#ee5f5b,#ee905b);background-image:linear-gradient(to bottom,#ee5f5b,#ee905b);border-color:#ee905b #ee905b #e56218;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25)}[date-picker] .now.active,[date-picker] .now.disabled,[date-picker] .now:active,[date-picker] .now:hover,[date-picker] .now[disabled]{color:#fff;background-color:#ee905b}[date-picker] .now.active,[date-picker] .now:active{background-color:#e9712d\9}[date-picker] .disabled{background:0 0;color:#999!important;cursor:default}[date-picker] [ng-switch-when=year] span,[date-picker] [ng-switch-when=month] span,[date-picker] [ng-switch-when=minutes] span{height:54px;line-height:54px}[date-picker] [ng-switch-when=date] td{padding:0}[date-picker] [ng-switch-when=date] span{width:100%;height:26px;line-height:26px}[date-picker] [ng-switch-when=date] td span:hover,[date-picker] th:hover{background:#eee;cursor:pointer} \ No newline at end of file +.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.date-picker-date-time{position:absolute}[date-picker-wrapper]{position:absolute;min-width:220px;z-index:10;display:block;font-size:14px}[date-time-append] [date-picker-wrapper] [date-picker]{margin-top:-30px}[date-time-append] [date-picker]{position:relative;margin-right:-1000px;margin-bottom:-1000px}[date-range] [date-picker] .after.before{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#499dcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f6ab4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f6ab4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f6ab4);background-image:-o-linear-gradient(top,#5bc0de,#2f6ab4);background-image:linear-gradient(to bottom,#5bc0de,#2f6ab4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f6ab4', GradientType=0);border-color:#2f6ab4 #2f6ab4 #1f4677;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#2f6ab4;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}[date-range] [date-picker] .after.before:hover,[date-range] [date-picker] .after.before:active,[date-range] [date-picker] .after.before.active,[date-range] [date-picker] .after.before.disabled,[date-range] [date-picker] .after.before[disabled]{color:#fff;background-color:#2f6ab4;*background-color:#2a5ea0}[date-range] [date-picker] .after.before:active,[date-range] [date-picker] .after.before.active{background-color:#24528c \9}[date-picker].hidden{display:none}[date-picker]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;background-color:#fff;padding:4px}[date-picker] table{margin:0}[date-picker] td,[date-picker] th{padding:4px 5px;text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}[date-picker] .switch{width:145px}[date-picker] span{display:block;width:23%;height:26px;line-height:25px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}[date-picker] span:hover{background:#eee}[date-picker] span.disabled,[date-picker] span.disabled:hover{background:0;color:#999;cursor:default}[date-picker] .active,[date-picker] .now{color:#fff;background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}[date-picker] .active:hover,[date-picker] .now:hover,[date-picker] .active:active,[date-picker] .now:active,[date-picker] .active.active,[date-picker] .now.active,[date-picker] .active.disabled,[date-picker] .now.disabled,[date-picker] .active[disabled],[date-picker] .now[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}[date-picker] .active:active,[date-picker] .now:active,[date-picker] .active.active,[date-picker] .now.active{background-color:#039 \9}[date-picker] .now{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#ee735b;background-image:-moz-linear-gradient(top,#ee5f5b,#ee905b);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#ee905b));background-image:-webkit-linear-gradient(top,#ee5f5b,#ee905b);background-image:-o-linear-gradient(top,#ee5f5b,#ee905b);background-image:linear-gradient(to bottom,#ee5f5b,#ee905b);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffee905b', GradientType=0);border-color:#ee905b #ee905b #e56218;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);*background-color:#ee905b;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}[date-picker] .now:hover,[date-picker] .now:active,[date-picker] .now.active,[date-picker] .now.disabled,[date-picker] .now[disabled]{color:#fff;background-color:#ee905b;*background-color:#ec8044}[date-picker] .now:active,[date-picker] .now.active{background-color:#e9712d \9}[date-picker] .disabled{background:0;color:#999!important;cursor:default}[date-picker] [ng-switch-when=year] span,[date-picker] [ng-switch-when=month] span,[date-picker] [ng-switch-when=minutes] span{height:54px;line-height:54px}[date-picker] [ng-switch-when=date] td{padding:0}[date-picker] [ng-switch-when=date] span{width:100%;height:26px;line-height:26px}[date-picker] th:hover,[date-picker] [ng-switch-when=date] td span:hover{background:#eee;cursor:pointer} \ No newline at end of file diff --git a/dist/index.min.js b/dist/index.min.js index 53111bc..71edbed 100644 --- a/dist/index.min.js +++ b/dist/index.min.js @@ -1 +1 @@ -"use strict";!function(a){var b=a.module("datePicker",["angularMoment"]);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",function(b,c){return{require:"?ngModel",template:'
',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(d,e,f,g){function h(){var a=d.view;d.model&&!j&&(d.date=new Date(d.model),j=!1);var b=d.date;switch(a){case"year":d.years=c.getVisibleYears(b);break;case"month":d.months=c.getVisibleMonths(b);break;case"date":d.weekdays=d.weekdays||c.getDaysOfWeek(),d.weeks=c.getVisibleWeeks(b);break;case"hours":d.hours=c.getVisibleHours(b);break;case"minutes":d.minutes=c.getVisibleMinutes(b,k)}}function i(){return"date"!==d.view?d.view:d.date?d.date.getMonth():null}var j=!1;d.date=new Date(d.model||new Date),d.views=b.views.concat(),d.view=f.view||b.view,d.now=new Date,d.template=f.template||b.template;var k=parseInt(f.step||b.step,10),l=!!f.partial;if(g){if(a.isDefined(f.minDate)){var m;g.$validators.min=function(b){return!c.isValidDate(b)||a.isUndefined(m)||b>=m},f.$observe("minDate",function(a){m=new Date(a),g.$validate()})}if(a.isDefined(f.maxDate)){var n;g.$validators.max=function(b){return!c.isValidDate(b)||a.isUndefined(n)||n>=b},f.$observe("maxDate",function(a){n=new Date(a),g.$validate()})}}d.views=d.views.slice(d.views.indexOf(f.maxView||"year"),d.views.indexOf(f.minView||"minutes")+1),(1===d.views.length||-1===d.views.indexOf(d.view))&&(d.view=d.views[0]),d.setView=function(a){-1!==d.views.indexOf(a)&&(d.view=a)},d.setDate=function(a){if(!f.disabled){d.date=a;var b=d.views[d.views.indexOf(d.view)+1];if(!b||l||d.model){d.model=new Date(d.model||a),g&&g.$setViewValue(d.date);var c=l?"minutes":d.view;switch(c){case"minutes":d.model.setMinutes(a.getMinutes());case"hours":d.model.setHours(a.getHours());case"date":d.model.setDate(a.getDate());case"month":d.model.setMonth(a.getMonth());case"year":d.model.setFullYear(a.getFullYear())}d.$emit("setDate",d.model,d.view)}b&&d.setView(b),b||"true"!==f.autoClose||(e.addClass("hidden"),d.$emit("hidePicker"))}},d.$watch(i,h),d.next=function(a){var b=d.date;switch(a=a||1,d.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)}j=!0,h()},d.prev=function(a){return d.next(-a||-1)},d.isAfter=function(a){return d.after&&c.isAfter(a,d.after)},d.isBefore=function(a){return d.before&&c.isBefore(a,d.before)},d.isSameMonth=function(a){return c.isSameMonth(d.model,a)},d.isSameYear=function(a){return c.isSameYear(d.model,a)},d.isSameDay=function(a){return c.isSameDay(d.model,a)},d.isSameHour=function(a){return c.isSameHour(d.model,a)},d.isSameMinutes=function(a){return c.isSameMinutes(d.model,a)},d.isNow=function(a){var b=!0,c=d.now;switch(d.view){case"minutes":b&=~~(a.getMinutes()/k)===~~(c.getMinutes()/k);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(Date.UTC(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.getUTCHours(),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())},toMomentFormat:function(a){function b(a,b,c){return c.replace(new RegExp(a,"g"),b)}var c=a;return c=b("y","Y",c),c=b("d","D",c),c=b("E","d",c),c=b("sss","SSS",c),c=b("w","W",c)}}});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","moment",function(b,e,f,g,h,i,j){var k=e.find("body"),l=f("date");return{require:"ngModel",scope:!0,link:function(e,f,m,n){function o(a){return l(a,t)}function p(a){if(a.length===t.length){var b=j(a,i.toMomentFormat(t));return b.isValid()?(r(),b.toDate()):void 0}return void 0}function q(a){a.stopPropagation(),n.$pristine&&(n.$dirty=!0,n.$pristine=!1,f.removeClass(c).addClass(d),u&&u.$setDirty(),n.$render())}function r(){z&&(z.remove(),z=null),B&&(B.remove(),B=null)}function s(){if(!z){if(z=b(E)(e),e.$digest(),e.$on("setDate",function(a,b,c){q(a),y&&v[v.length-1]===c&&r()}),e.$on("hidePicker",function(){f.triggerHandler("blur")}),e.$on("$destroy",r),"absolute"===A){var c=a.extend(f.offset(),{height:f[0].offsetHeight});z.css({top:c.top+c.height,left:c.left,display:"block",position:A}),k.append(z)}else B=a.element("
"),f[0].parentElement.insertBefore(B[0],f[0]),B.append(z),z.css({top:f[0].offsetHeight+"px",display:"block"});z.bind("mousedown",function(a){a.preventDefault()})}}var t=m.format||g.format,u=f.inheritedData("$formController"),v=h(m.views)(e)||g.views.concat(),w=m.view||v[0],x=v.indexOf(w),y=m.autoClose?h(m.autoClose)(e):g.autoClose,z=null,A=m.position||g.position,B=null;if(-1===x&&v.splice(x,1),v.unshift(w),n.$formatters.push(o),n.$parsers.unshift(p),a.isDefined(m.minDate)){var C;n.$validators.min=function(b){return!i.isValidDate(b)||a.isUndefined(C)||b>=C},m.$observe("minDate",function(a){C=new Date(a),n.$validate()})}if(a.isDefined(m.maxDate)){var D;n.$validators.max=function(b){return!i.isValidDate(b)||a.isUndefined(D)||D>=b},m.$observe("maxDate",function(a){D=new Date(a),n.$validate()})}var E=g.template(m);f.bind("focus",s),f.bind("blur",r)}}}]),a.module("datePicker").run(["$templateCache",function(a){a.put("app/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("app/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(a){var b=a.module("datePicker",["angularMoment"]);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",function(b,c){return{require:"?ngModel",template:'
',scope:{model:"=datePicker",after:"=?",before:"=?"},link:function(d,e,f,g){function h(){var a=d.view;d.model&&!j&&(d.date=new Date(d.model),j=!1);var b=d.date;switch(a){case"year":d.years=c.getVisibleYears(b);break;case"month":d.months=c.getVisibleMonths(b);break;case"date":d.weekdays=d.weekdays||c.getDaysOfWeek(),d.weeks=c.getVisibleWeeks(b);break;case"hours":d.hours=c.getVisibleHours(b);break;case"minutes":d.minutes=c.getVisibleMinutes(b,k)}}function i(){return"date"!==d.view?d.view:d.date?d.date.getMonth():null}var j=!1;d.date=new Date(d.model||new Date),d.views=b.views.concat(),d.view=f.view||b.view,d.now=new Date,d.template=f.template||b.template;var k=parseInt(f.step||b.step,10),l=!!f.partial;if(g){if(a.isDefined(f.minDate)){var m;g.$validators.min=function(b){return!c.isValidDate(b)||a.isUndefined(m)||b>=m},f.$observe("minDate",function(a){m=new Date(a),g.$validate()})}if(a.isDefined(f.maxDate)){var n;g.$validators.max=function(b){return!c.isValidDate(b)||a.isUndefined(n)||n>=b},f.$observe("maxDate",function(a){n=new Date(a),g.$validate()})}}d.views=d.views.slice(d.views.indexOf(f.maxView||"year"),d.views.indexOf(f.minView||"minutes")+1),(1===d.views.length||-1===d.views.indexOf(d.view))&&(d.view=d.views[0]),d.setView=function(a){-1!==d.views.indexOf(a)&&(d.view=a)},d.setDate=function(a){if(!f.disabled){d.date=a;var b=d.views[d.views.indexOf(d.view)+1];if(!b||l||d.model){d.model=new Date(d.model||a),g&&g.$setViewValue(d.date);var c=l?"minutes":d.view;switch(c){case"minutes":d.model.setMinutes(a.getMinutes());case"hours":d.model.setHours(a.getHours());case"date":d.model.setDate(a.getDate());case"month":d.model.setMonth(a.getMonth());case"year":d.model.setFullYear(a.getFullYear())}d.$emit("setDate",d.model,d.view)}b&&d.setView(b),b||"true"!==f.autoClose||(e.addClass("hidden"),d.$emit("hidePicker"))}},d.$watch(i,h),d.next=function(a){var b=d.date;switch(a=a||1,d.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)}j=!0,h()},d.prev=function(a){return d.next(-a||-1)},d.isAfter=function(a){return d.after&&c.isAfter(a,d.after)},d.isBefore=function(a){return d.before&&c.isBefore(a,d.before)},d.isSameMonth=function(a){return c.isSameMonth(d.model,a)},d.isSameYear=function(a){return c.isSameYear(d.model,a)},d.isSameDay=function(a){return c.isSameDay(d.model,a)},d.isSameHour=function(a){return c.isSameHour(d.model,a)},d.isSameMinutes=function(a){return c.isSameMinutes(d.model,a)},d.isNow=function(a){var b=!0,c=d.now;switch(d.view){case"minutes":b&=~~(a.getMinutes()/k)===~~(c.getMinutes()/k);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(Date.UTC(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.getUTCHours(),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),a.setDate(0===a.getDay()?-5: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())},toMomentFormat:function(a){function b(a,b,c){return c.replace(new RegExp(a,"g"),b)}var c=a;return c=b("y","Y",c),c=b("d","D",c),c=b("E","d",c),c=b("sss","SSS",c),c=b("w","W",c)}}});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","moment",function(b,e,f,g,h,i,j){var k=e.find("body"),l=f("date");return{require:"ngModel",scope:!0,link:function(e,f,m,n){function o(a){return l(a,t)}function p(a){if(a.length===t.length){var b=j(a,i.toMomentFormat(t));return b.isValid()?(r(),b.toDate()):void 0}return void 0}function q(a){a.stopPropagation(),n.$pristine&&(n.$dirty=!0,n.$pristine=!1,f.removeClass(c).addClass(d),u&&u.$setDirty(),n.$render())}function r(){z&&(z.remove(),z=null),B&&(B.remove(),B=null)}function s(){if(!z){if(z=b(E)(e),e.$digest(),e.$on("setDate",function(a,b,c){q(a),y&&v[v.length-1]===c&&r()}),e.$on("hidePicker",function(){f.triggerHandler("blur")}),e.$on("$destroy",r),"absolute"===A){var c=a.extend(f.offset(),{height:f[0].offsetHeight});z.css({top:c.top+c.height,left:c.left,display:"block",position:A}),k.append(z)}else B=a.element("
"),f[0].parentElement.insertBefore(B[0],f[0]),B.append(z),z.css({top:f[0].offsetHeight+"px",display:"block"});z.bind("mousedown",function(a){a.preventDefault()})}}var t=m.format||g.format,u=f.inheritedData("$formController"),v=h(m.views)(e)||g.views.concat(),w=m.view||v[0],x=v.indexOf(w),y=m.autoClose?h(m.autoClose)(e):g.autoClose,z=null,A=m.position||g.position,B=null;if(-1===x&&v.splice(x,1),v.unshift(w),n.$formatters.push(o),n.$parsers.unshift(p),a.isDefined(m.minDate)){var C;n.$validators.min=function(b){return!i.isValidDate(b)||a.isUndefined(C)||b>=C},m.$observe("minDate",function(a){C=new Date(a),n.$validate()})}if(a.isDefined(m.maxDate)){var D;n.$validators.max=function(b){return!i.isValidDate(b)||a.isUndefined(D)||D>=b},m.$observe("maxDate",function(a){D=new Date(a),n.$validate()})}var E=g.template(m);f.bind("focus",s),f.bind("blur",r)}}}]),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