From 93488569f9c89af62d212c5d53bc24f39afbd13b Mon Sep 17 00:00:00 2001 From: Michel Couillard Date: Mon, 24 Jul 2017 17:14:20 -0400 Subject: [PATCH] version 1.7.1 --- README.md | 12 ++++++------ bower.json | 2 +- dist/angular-material-datetimepicker.min.js | 2 +- dist/angular-material-datetimepicker.min.js.map | 2 +- dist/material-datetimepicker.min.css | 2 +- package.json | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b369ce7..33f5ce7 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,15 @@ bower install ng-material-datetimepicker ## CDN ``` - - - + + + ``` or ``` - - - + + + ``` ## Live Example diff --git a/bower.json b/bower.json index c6cd6f0..5624e9f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "ng-material-datetimepicker", "description": "A datetime picker for AngularJS Material", - "version": "1.7.0", + "version": "1.7.1", "keywords": [ "css", "js", diff --git a/dist/angular-material-datetimepicker.min.js b/dist/angular-material-datetimepicker.min.js index 5af41d4..721420d 100644 --- a/dist/angular-material-datetimepicker.min.js +++ b/dist/angular-material-datetimepicker.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function t(t){var e="ngMaterialDatePicker",a={DATE:0,HOUR:1,MINUTE:2},i=function(t,e){return t=angular.element(t),"getComputedStyle"in window?window.getComputedStyle(t[0])[e]:t.css(e)},r='
{{picker.currentNearestMinute().format("dddd")}}
{{picker.params.shortTime ? picker.currentDate.format("A") : " "}}
×
{{picker.currentDate.format("MMM") | uppercase}}
{{picker.currentDate.format("DD")}}
{{picker.currentDate.format("YYYY")}}
{{picker.currentNearestMinute().format(picker.params.shortTime ? "hh:mm" : "HH:mm")}} {{picker.currentDate.format("A")}}
{{picker.currentNearestMinute().format(picker.params.shortTime ? "hh:mm" : "HH:mm")}}
{{picker.params.todayText}} {{picker.params.cancelText}} {{picker.params.okText}}
';angular.module(e,["ngMaterial"]).provider("mdcDatetimePickerDefaultLocale",function(){this.locale=window.navigator.userLanguage||window.navigator.language||"en",this.$get=function(){return this},this.setDefaultLocale=function(t){this.locale=t}}).factory("mdcDefaultParams",["mdcDatetimePickerDefaultLocale",function(t){return{date:!0,time:!0,minutes:!0,format:"YYYY-MM-DD",minDate:null,maxDate:null,currentDate:null,lang:t.locale,weekStart:0,shortTime:!1,cancelText:"Cancel",okText:"OK",amText:"AM",pmText:"PM",todayText:"Today",disableDates:[],disableParentScroll:!1,autoOk:!1,editInput:!1,clickOutsideToClose:!1,minuteSteps:5}}]).directive("mdcDatetimePicker",["$mdDialog","$timeout",function(e,a){return{restrict:"A",require:"ngModel",scope:{currentDate:"=ngModel",ngChange:"&",time:"=",date:"=",minutes:"=",minDate:"=",maxDate:"=",disableDates:"=",shortTime:"=",weekStart:"=",format:"@",cancelText:"@",okText:"@",lang:"@",amText:"@",pmText:"@",showTodaysDate:"@",todayText:"@",disableParentScroll:"=",autoOk:"=",editInput:"=",clickOutsideToClose:"=",minuteSteps:"="},link:function(i,s,o,c){var l=!1;i.format||(i.date&&i.time?i.format="YYYY-MM-DD HH:mm":i.date?i.format="YYYY-MM-DD":i.format="HH:mm");var d=null;void 0!==i.showTodaysDate&&"false"!==i.showTodaysDate&&(d=t()),angular.isString(i.currentDate)&&""!==i.currentDate&&(i.currentDate=t(i.currentDate,i.format)),c&&(c.$options=c.$options.createChild({"*":"$inherit",debounce:500}),c.$formatters.push(function(e){if(void 0!==e){var a=t(e);return a.isValid()?a.format(i.format):""}}),c.$parsers.push(function(e){if(void 0!==e){var a=t(e,i.format);return a.isValid()?a._d:void 0}})),i.editInput||s.on("focus",function(c){if(c.preventDefault(),s.blur(),s.parent().removeClass("md-input-focused"),!l){l=!0;var u={};for(var m in o)i.hasOwnProperty(m)&&!angular.isUndefined(i[m])&&(u[m]=i[m]);u.currentDate=i.currentDate,u.showTodaysDate=d;var p={options:u};e.show({template:r,controller:n,controllerAs:"picker",locals:p,openFrom:s,parent:angular.element(document.body),bindToController:!0,clickOutsideToClose:u.clickOutsideToClose||!1,disableParentScroll:u.disableParentScroll||!1,hasBackDrop:!1,skipHide:!0,multiple:!0}).then(function(e){i.currentDate=e?e._d:e,l=!1,t(i.currentDate).isSame(u.currentDate)||a(i.ngChange,0),s.parent().removeClass("md-input-focused")},function(){l=!1,s.parent().removeClass("md-input-focused")})}})}}}]).factory("mdcDateTimeDialog",["$mdDialog","$q","mdcDefaultParams",function(e,a,i){var s=Object.keys(i);return{show:function(o){var c=a.defer();angular.copy(i);for(var l in o)-1!=s.indexOf[l]&&o.hasOwnProperty(l)&&o[l];var d=null;void 0!==o.showTodaysDate&&"false"!==o.showTodaysDate&&(d=t()),o.showTodaysDate=d;var u={options:o};return e.show({template:r,controller:n,controllerAs:"picker",locals:u,parent:angular.element(document.body),bindToController:!0,clickOutsideToClose:o.clickOutsideToClose||!1,disableParentScroll:o.disableParentScroll||!1,skipHide:!0,multiple:!0}).then(function(t){t&&t._d;c.resolve(t?t._d:t)},function(){c.reject()}),c.promise}}}]);var n=function(t,e,i){this.currentView=a.DATE,this._dialog=e,this._attachedEvents=[],this.VIEWS=a,this.params=angular.copy(i),this.meridien="AM",this.params=angular.extend(this.params,this.options),this.init()};return n.$inject=["$scope","$mdDialog","mdcDefaultParams"],n.prototype={init:function(){this.timeMode=this.params.time&&!this.params.date,this.dateMode=this.params.date,this.initDates(),this.start()},currentNearestMinute:function(){var e=this.params.minuteSteps;(e<1||e>59)&&(e=1);var a=this.currentDate||t(),i=e*Math.round(a.minute()/e);return i>=60&&(i=60-e),t(a).minutes(i)},initDates:function(){var e=this,a=function(a,i){var r=null;if(angular.isDefined(a)&&null!==a&&""!==a)if(angular.isString(a))r=void 0!==e.params.format&&null!==e.params.format?t(a,e.params.format).locale(e.params.lang):t(a).locale(e.params.lang);else if("number"==typeof a)r=t(a).locale(e.params.lang);else if(angular.isDate(a)){var n=a.getTime();r=t(n,"x").locale(e.params.lang)}else a._isAMomentObject&&(r=a);else r=i;return r};this.currentDate=a(this.params.currentDate,t()),this.minDate=a(this.params.minDate),this.maxDate=a(this.params.maxDate),this.disableDates=this.params.disableDates.map(function(e){return t(e).format("MMMM Do YYYY")}),this.selectDate(this.currentDate)},initDate:function(){this.currentView=a.DATE},initHours:function(){this.currentView=a.HOUR},initMinutes:function(){this.currentView=a.MINUTE},isAfterMinDate:function(e,a,i){var r=!0;if(void 0!==this.minDate&&null!==this.minDate){var n=t(this.minDate),s=t(e);a||i||(n.hour(0),n.minute(0),s.hour(0),s.minute(0)),n.second(0),s.second(0),n.millisecond(0),s.millisecond(0),i?r=parseInt(s.format("X"))>=parseInt(n.format("X")):(s.minute(0),n.minute(0),r=parseInt(s.format("X"))>=parseInt(n.format("X")))}return r},isBeforeMaxDate:function(e,a,i){var r=!0;if(void 0!==this.maxDate&&null!==this.maxDate){var n=t(this.maxDate),s=t(e);a||i||(n.hour(0),n.minute(0),s.hour(0),s.minute(0)),n.second(0),s.second(0),n.millisecond(0),s.millisecond(0),i?r=parseInt(s.format("X"))<=parseInt(n.format("X")):(s.minute(0),n.minute(0),r=parseInt(s.format("X"))<=parseInt(n.format("X")))}return r},isInDisableDates:function(t){var e=t.format("MMMM Do YYYY");return!(this.disableDates.indexOf(e)>-1)},selectDate:function(e){e&&(this.currentDate=t(e),this.isAfterMinDate(this.currentDate)||(this.currentDate=t(this.minDate)),this.isBeforeMaxDate(this.currentDate)||(this.currentDate=t(this.maxDate)),this.currentDate.locale(this.params.lang),this.calendarStart=t(this.currentDate),this.meridien=this.currentDate.hour()>=12?"PM":"AM")},setName:function(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=0;a<5;a++)t+=e.charAt(Math.floor(Math.random()*e.length));return t},isPM:function(){return"PM"===this.meridien},incrementMonth:function(t){1===t&&this.isNextMonthVisible()&&this.selectDate(this.currentDate.add(t,"month")),-1===t&&this.isPreviousMonthVisible()&&this.selectDate(this.currentDate.add(t,"month"))},incrementYear:function(t){1===t&&this.isNextYearVisible()&&this.selectDate(this.currentDate.add(t,"year")),-1===t&&this.isPreviousYearVisible()&&this.selectDate(this.currentDate.add(t,"year"))},isPreviousMonthVisible:function(){return this.calendarStart&&this.isAfterMinDate(t(this.calendarStart).startOf("month"),!1,!1)},isNextMonthVisible:function(){return this.calendarStart&&this.isBeforeMaxDate(t(this.calendarStart).endOf("month"),!1,!1)},isPreviousYearVisible:function(){return this.calendarStart&&this.isAfterMinDate(t(this.calendarStart).startOf("year"),!1,!1)},isNextYearVisible:function(){return this.calendarStart&&this.isBeforeMaxDate(t(this.calendarStart).endOf("year"),!1,!1)},isHourAvailable:function(e){var a=t(this.currentDate);return this.params.shortTime?a.hour(this.convertHours(e)).minute(0).second(0):a.hour(e).minute(0).second(0),this.isAfterMinDate(a,!0,!1)&&this.isBeforeMaxDate(a,!0,!1)},isMinuteAvailable:function(e){var a=t(this.currentDate);return a.minute(e).second(0),this.isAfterMinDate(a,!0,!0)&&this.isBeforeMaxDate(a,!0,!0)},start:function(){this.currentView=a.DATE,this.params.date?this.initDate():this.params.time&&this.initHours()},today:function(){var e=this.params.minuteSteps,a=t(),i=e*Math.round(a.minute()/e);i>=60&&(i=60-e),this.selectDate(t(a).minutes(i))},ok:function(){switch(this.currentView){case a.DATE:!0===this.params.time?this.initHours():this.hide(!0);break;case a.HOUR:!0===this.params.minutes?this.initMinutes():this.hide(!0);break;case a.MINUTE:this.hide(!0)}},cancel:function(){if(this.params.time)switch(this.currentView){case a.DATE:this.hide();break;case a.HOUR:this.params.date?this.initDate():this.hide();break;case a.MINUTE:this.initHours()}else this.hide()},selectMonthBefore:function(){this.calendarStart.subtract(1,"months")},selectMonthAfter:function(){this.calendarStart.add(1,"months")},selectYearBefore:function(){this.calendarStart.subtract(1,"years")},selectYearAfter:function(){this.calendarStart.add(1,"years")},selectAM:function(){(this.isHourAvailable(0)||this.isHourAvailable(12))&&(this.currentDate.hour()>=12&&this.selectDate(this.currentDate.subtract(12,"hours")),this.isHourAvailable(this.currentDate.hour())||this.selectDate(this.currentDate.hour(this.minDate.hour())),this.isMinuteAvailable(this.currentDate.minute())||this.selectDate(this.currentDate.minute(this.minDate.minute())))},selectPM:function(){(this.isHourAvailable(13)||this.isHourAvailable(24))&&(this.currentDate.hour()<12&&this.selectDate(this.currentDate.add(12,"hours")),this.isHourAvailable(this.currentDate.hour())||this.selectDate(this.currentDate.hour(this.maxDate.hour())),this.isMinuteAvailable(this.currentDate.minute())||this.selectDate(this.currentDate.minute(this.maxDate.minute())))},convertHours:function(t){var e=t;return t<12&&this.isPM()&&(e+=12),e},hide:function(t){t?this._dialog.hide(this.currentDate):this._dialog.cancel()}},angular.module(e).directive("mdcDatetimePickerCalendar",[function(){for(var e=12*((new Date).getFullYear()+30-1920+1),a=[],i=0;i6&&(i=0),t.push(i.toString());if(s.week=t,n.maxDate||n.minDate){var o=n.minDate?r(n.minDate):0,c=n.maxDate?r(n.maxDate)+1:e;s.months=a.slice(o,c)}else s.months=a;s.topIndex=r(n.currentDate)-s.months[0]},1===angular.version.major&&angular.version.minor<5&&this.$onInit(),s.getItemAtIndex=function(e){var a=(e+1)%12||12,i=1920+Math.floor(e/12),r=t(n.currentDate).year(i).month(a);return o(r)},i.$watch(function(){return n.currentDate?n.currentDate.format("YYYY-MM"):""},function(e,a){if(e!=a){var i=t(e,"YYYY-MM"),o=n.minDate?r(n.minDate):0,c=r(i,o);s.topIndex!=c&&(s.topIndex=c)}});var o=function(e){var a={};if(null!==e){a.name=e.format("MMMM YYYY");var i=t(e).locale(n.params.lang).startOf("month").hour(e.hour()).minute(e.minute()),r=i.format("d");a.days=[];for(var o=i.date();o<=i.daysInMonth();o++){if(o===i.date()){var c=s.week.indexOf(r.toString());if(c>0)for(var l=0;l
'}}]).directive("mdcDatetimePickerCalendarMonth",["$compile",function(t){var e=function(e,a){var i=angular.element(e[0].querySelector("tbody")),r=a.cal,n=[];a.month.days.forEach(function(t,e){n.push(""),t.forEach(function(t,a){if(n.push(""),t)if(r.isInRange(t)){var i="month['days']["+e+"]["+a+"]";n.push(''),n.push(t.format("D")),n.push("")}else n.push(''),n.push(t.format("D")),n.push("");n.push("")}),n.push("")}),i.html(n.join("")),t(i)(a)};return{scope:{idx:"="},require:"^mdcDatetimePickerCalendar",restrict:"AE",template:'
{{month.name}}
{{cal.toDay(day)}}
',link:function(t,a,i,r){t.cal=r,t.month=r.getItemAtIndex(parseInt(t.idx)),e(a,t),t.$watch(function(){return t.idx},function(i,n){i!=n&&(t.month=r.getItemAtIndex(parseInt(t.idx)),e(a,t))})}}}]),angular.module(e).directive("mdcDtpNoclick",function(){return{link:function(t,e){e.on("click",function(t){t.preventDefault()})}}}),angular.module(e).directive("mdcDatetimePickerClock",["$timeout",function(t){return{restrict:"E",template:'',link:function(e,a,r){var n="minutes"===r.mode,s=e.picker,o=document.querySelector("md-dialog.dtp"),c=function(t,e){var a=0;if(0!==(t=t>=360?0:t)){var i=n?60:12;a=Math.round(i/360*t)}if(n){var r=s.params.minuteSteps;(r<1||r>59)&&(r=1);var o=r*Math.round(a/r);o>=60&&(o=60-r),s.currentDate.minute(o)}else 12===a&&(a=0),s.params.shortTime||(s.meridien=e>84?"AM":"PM"),s.currentDate.hour(s.isPM()?a+12:a);s.currentDate.second(0)},l="ontouchstart"in window,d={POINTER_DOWN:l?"touchstart":"mousedown",POINTER_UP:l?"touchend":"mouseup",POINTER_MOVE:l?"touchmove":"mousemove"},u=function(e){e.preventDefault();var a=e.currentTarget.closest("div"),i=a.getClientRects()[0];l&&(e=e.changedTouches[0]);var r=a.offsetWidth/2-(e.pageX-i.left),n=e.pageY-i.top-a.offsetHeight/2,s=Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),o=Math.round(Math.atan2(r,n)*(180/Math.PI));t(function(){c(o+180,s)})};a.on(d.POINTER_DOWN,function(){a.on(d.POINTER_MOVE,u)}),a.on(d.POINTER_UP,function(){a.off(d.POINTER_MOVE)}),e.$on("$destroy",function(){a.off(d.POINTER_MOVE,u)});var m=function(){var t=angular.element(a[0].querySelector(".dtp-picker-clock")),c=angular.element(o.querySelector(".dtp-picker")),l=o.querySelector(".dtp-content").offsetWidth,d=parseInt(i(c,"paddingLeft").replace("px",""))||0,u=parseInt(i(c,"paddingRight").replace("px",""))||0,m=l-((parseInt(i(t,"marginLeft").replace("px",""))||0)+(parseInt(i(t,"marginRight").replace("px",""))||0)+d+u);t.css("width",m+"px");for(var h=parseInt(i(c,"paddingLeft").replace("px",""))||0,v=parseInt(i(c,"paddingTop").replace("px",""))||0,D=parseInt(i(t,"marginLeft").replace("px",""))||0,g=parseInt(i(t,"marginTop").replace("px",""))||0,k=m/2,M=k/1.2,y=[],x=0;x<12;++x){var b=k+M*Math.sin(2*Math.PI*(x/12))+h/2-(h+D),T=k-M*Math.cos(2*Math.PI*(x/12))-g/2-(v+g),w={left:b,top:T,value:n?5*x:x,style:{"margin-left":b+"px","margin-top":T+"px"}};n?w.display=w.value<10?"0"+w.value:w.value:s.params.shortTime?w.display=0===x?12:x:w.display=x,y.push(w)}if(e.points=y,!s.params.shortTime&&!n){for(var I=[],A=k/1.8,P=12;P<24;++P){var S=k+A*Math.sin(2*Math.PI*(P/12))+h/2-(h+D),Y=k-A*Math.cos(2*Math.PI*(P/12))-g/2-(v+g),O={left:S,top:Y,value:P,style:{"margin-left":S+"px","margin-top":Y+"px"}};O.display=P,I.push(O)}e.points24=I}e.mode=r.mode,f(),t.css("height",m+"px");var V=a[0].querySelector(".dtp-clock-center"),E=V.offsetWidth/2||7.5,H=V.offsetHeight/2||7.5,N=k/(s.params.shortTime?1.8:2.3),C=k/1.5;angular.element(a[0].querySelector(".dtp-hour-hand")).css({left:k+1.5*D+"px",height:N+"px",marginTop:k-N-h+"px"}).addClass(n?"":"on"),angular.element(a[0].querySelector(".dtp-minute-hand")).css({left:k+1.5*D+"px",height:C+"px",marginTop:k-C-h+"px"}).addClass(n?"on":""),angular.element(V).css({left:k+h+D-E+"px",marginTop:k-D/2-H+"px"}),p()},p=function(){var t=s.currentNearestMinute(),e=t.hour(),i=t.minute();h(angular.element(a[0].querySelector(".dtp-hour-hand")),30*e),h(angular.element(a[0].querySelector(".dtp-minute-hand")),6*i)},h=function(t,e){angular.element(t).css({WebkitTransform:"rotate("+e+"deg)","-moz-transform":"rotate("+e+"deg)","-ms-transform":"rotate("+e+"deg)",transform:"rotate("+e+"deg)"})},f=function(){var t=s.currentNearestMinute(),a=s.params.shortTime?12:24;e.currentValue=n?t.minute():t.hour()%a};e.$watch(function(){var t=s.currentNearestMinute();return t?t.format("HH:mm"):""},function(){f(),p()}),e.setTime=function(t){n?(t===e.currentValue&&s.ok(),s.currentDate.minute(t)):(t!==e.currentValue||s.params.autoOk||s.ok(),s.params.shortTime?s.currentDate.hour(s.isPM()?t+12:t):(s.currentDate.hour(t),s.meridien=t>=12?"PM":"AM"),s.params.autoOk&&s.ok()),s.currentDate.second(0)},e.pointAvailable=function(t){return n?s.isMinuteAvailable(t.value):s.isHourAvailable(t.value)};var v=e.$watch(function(){return a[0].querySelectorAll("div").length},function(){m(),v()})}}}]),e}var e=window&&window.process&&window.process.type;"function"==typeof define&&define.amd?define(["moment"],t):"undefined"!=typeof module&&module&&module.exports&&"function"==typeof require&&!e?module.exports=t(require("moment")):t(("undefined"!=typeof global?global:window).moment)}(); +!function(){"use strict";function t(t){var e="ngMaterialDatePicker",a={DATE:0,HOUR:1,MINUTE:2},i=function(t,e){return t=angular.element(t),"getComputedStyle"in window?window.getComputedStyle(t[0])[e]:t.css(e)},r='
{{picker.currentNearestMinute().format("dddd")}}
{{picker.params.shortTime ? picker.currentDate.format("A") : " "}}
×
{{picker.currentDate.format("MMM") | uppercase}}
{{picker.currentDate.format("DD")}}
{{picker.currentDate.format("YYYY")}}
{{picker.currentNearestMinute().format(picker.params.shortTime ? "hh:mm" : "HH:mm")}} {{picker.currentDate.format("A")}}
{{picker.currentNearestMinute().format(picker.params.shortTime ? "hh:mm" : "HH:mm")}}
{{picker.params.todayText}} {{picker.params.cancelText}} {{picker.params.okText}}
';angular.module(e,["ngMaterial"]).provider("mdcDatetimePickerDefaultLocale",function(){this.locale=window.navigator.userLanguage||window.navigator.language||"en",this.$get=function(){return this},this.setDefaultLocale=function(t){this.locale=t}}).factory("mdcDefaultParams",["mdcDatetimePickerDefaultLocale",function(t){return{date:!0,time:!0,minutes:!0,format:"YYYY-MM-DD",minDate:null,maxDate:null,currentDate:null,lang:t.locale,weekStart:0,shortTime:!1,cancelText:"Cancel",okText:"OK",amText:"AM",pmText:"PM",todayText:"Today",disableDates:[],disableParentScroll:!1,autoOk:!1,editInput:!1,clickOutsideToClose:!1,minuteSteps:5}}]).directive("mdcDatetimePicker",["$mdDialog","$timeout",function(e,a){return{restrict:"A",require:"ngModel",scope:{currentDate:"=ngModel",ngChange:"&",time:"=",date:"=",minutes:"=",minDate:"=",maxDate:"=",disableDates:"=",shortTime:"=",weekStart:"=",format:"@",cancelText:"@",okText:"@",lang:"@",amText:"@",pmText:"@",showTodaysDate:"@",todayText:"@",disableParentScroll:"=",autoOk:"=",editInput:"=",clickOutsideToClose:"=",minuteSteps:"="},link:function(i,s,o,c){var l=!1;i.format||(i.date&&i.time?i.format="YYYY-MM-DD HH:mm":i.date?i.format="YYYY-MM-DD":i.format="HH:mm");var d=null;if(void 0!==i.showTodaysDate&&"false"!==i.showTodaysDate&&(d=t()),angular.isString(i.currentDate)&&""!==i.currentDate&&(i.currentDate=t(i.currentDate,i.format)),c){var u={"*":"$inherit",debounce:500};c.$options=c.$options?c.$options.createChild(u):u,c.$formatters.push(function(e){if(void 0!==e){var a=t(e);return a.isValid()?a.format(i.format):""}}),c.$parsers.push(function(e){if(void 0!==e){var a=t(e,i.format);return a.isValid()?a._d:void 0}})}i.editInput||s.on("focus",function(c){if(c.preventDefault(),s.blur(),s.parent().removeClass("md-input-focused"),!l){l=!0;var u={};for(var m in o)i.hasOwnProperty(m)&&!angular.isUndefined(i[m])&&(u[m]=i[m]);u.currentDate=i.currentDate,u.showTodaysDate=d;var p={options:u};e.show({template:r,controller:n,controllerAs:"picker",locals:p,openFrom:s,parent:angular.element(document.body),bindToController:!0,clickOutsideToClose:u.clickOutsideToClose||!1,disableParentScroll:u.disableParentScroll||!1,hasBackDrop:!1,skipHide:!0,multiple:!0}).then(function(e){i.currentDate=e?e._d:e,l=!1,t(i.currentDate).isSame(u.currentDate)||a(i.ngChange,0),s.parent().removeClass("md-input-focused")},function(){l=!1,s.parent().removeClass("md-input-focused")})}})}}}]).factory("mdcDateTimeDialog",["$mdDialog","$q","mdcDefaultParams",function(e,a,i){var s=Object.keys(i);return{show:function(o){var c=a.defer();angular.copy(i);for(var l in o)-1!=s.indexOf[l]&&o.hasOwnProperty(l)&&o[l];var d=null;void 0!==o.showTodaysDate&&"false"!==o.showTodaysDate&&(d=t()),o.showTodaysDate=d;var u={options:o};return e.show({template:r,controller:n,controllerAs:"picker",locals:u,parent:angular.element(document.body),bindToController:!0,clickOutsideToClose:o.clickOutsideToClose||!1,disableParentScroll:o.disableParentScroll||!1,skipHide:!0,multiple:!0}).then(function(t){t&&t._d;c.resolve(t?t._d:t)},function(){c.reject()}),c.promise}}}]);var n=function(t,e,i){this.currentView=a.DATE,this._dialog=e,this._attachedEvents=[],this.VIEWS=a,this.params=angular.copy(i),this.meridien="AM",this.params=angular.extend(this.params,this.options),this.init()};return n.$inject=["$scope","$mdDialog","mdcDefaultParams"],n.prototype={init:function(){this.timeMode=this.params.time&&!this.params.date,this.dateMode=this.params.date,this.initDates(),this.start()},currentNearestMinute:function(){var e=this.params.minuteSteps;(e<1||e>59)&&(e=1);var a=this.currentDate||t(),i=e*Math.round(a.minute()/e);return i>=60&&(i=60-e),t(a).minutes(i)},initDates:function(){var e=this,a=function(a,i){var r=null;if(angular.isDefined(a)&&null!==a&&""!==a)if(angular.isString(a))r=void 0!==e.params.format&&null!==e.params.format?t(a,e.params.format).locale(e.params.lang):t(a).locale(e.params.lang);else if("number"==typeof a)r=t(a).locale(e.params.lang);else if(angular.isDate(a)){var n=a.getTime();r=t(n,"x").locale(e.params.lang)}else a._isAMomentObject&&(r=a);else r=i;return r};this.currentDate=a(this.params.currentDate,t()),this.minDate=a(this.params.minDate),this.maxDate=a(this.params.maxDate),this.disableDates=this.params.disableDates.map(function(e){return t(e).format("MMMM Do YYYY")}),this.selectDate(this.currentDate)},initDate:function(){this.currentView=a.DATE},initHours:function(){this.currentView=a.HOUR},initMinutes:function(){this.currentView=a.MINUTE},isAfterMinDate:function(e,a,i){var r=!0;if(void 0!==this.minDate&&null!==this.minDate){var n=t(this.minDate),s=t(e);a||i||(n.hour(0),n.minute(0),s.hour(0),s.minute(0)),n.second(0),s.second(0),n.millisecond(0),s.millisecond(0),i?r=parseInt(s.format("X"))>=parseInt(n.format("X")):(s.minute(0),n.minute(0),r=parseInt(s.format("X"))>=parseInt(n.format("X")))}return r},isBeforeMaxDate:function(e,a,i){var r=!0;if(void 0!==this.maxDate&&null!==this.maxDate){var n=t(this.maxDate),s=t(e);a||i||(n.hour(0),n.minute(0),s.hour(0),s.minute(0)),n.second(0),s.second(0),n.millisecond(0),s.millisecond(0),i?r=parseInt(s.format("X"))<=parseInt(n.format("X")):(s.minute(0),n.minute(0),r=parseInt(s.format("X"))<=parseInt(n.format("X")))}return r},isInDisableDates:function(t){var e=t.format("MMMM Do YYYY");return!(this.disableDates.indexOf(e)>-1)},selectDate:function(e){e&&(this.currentDate=t(e),this.isAfterMinDate(this.currentDate)||(this.currentDate=t(this.minDate)),this.isBeforeMaxDate(this.currentDate)||(this.currentDate=t(this.maxDate)),this.currentDate.locale(this.params.lang),this.calendarStart=t(this.currentDate),this.meridien=this.currentDate.hour()>=12?"PM":"AM")},setName:function(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=0;a<5;a++)t+=e.charAt(Math.floor(Math.random()*e.length));return t},isPM:function(){return"PM"===this.meridien},incrementMonth:function(t){1===t&&this.isNextMonthVisible()&&this.selectDate(this.currentDate.add(t,"month")),-1===t&&this.isPreviousMonthVisible()&&this.selectDate(this.currentDate.add(t,"month"))},incrementYear:function(t){1===t&&this.isNextYearVisible()&&this.selectDate(this.currentDate.add(t,"year")),-1===t&&this.isPreviousYearVisible()&&this.selectDate(this.currentDate.add(t,"year"))},isPreviousMonthVisible:function(){return this.calendarStart&&this.isAfterMinDate(t(this.calendarStart).startOf("month"),!1,!1)},isNextMonthVisible:function(){return this.calendarStart&&this.isBeforeMaxDate(t(this.calendarStart).endOf("month"),!1,!1)},isPreviousYearVisible:function(){return this.calendarStart&&this.isAfterMinDate(t(this.calendarStart).startOf("year"),!1,!1)},isNextYearVisible:function(){return this.calendarStart&&this.isBeforeMaxDate(t(this.calendarStart).endOf("year"),!1,!1)},isHourAvailable:function(e){var a=t(this.currentDate);return this.params.shortTime?a.hour(this.convertHours(e)).minute(0).second(0):a.hour(e).minute(0).second(0),this.isAfterMinDate(a,!0,!1)&&this.isBeforeMaxDate(a,!0,!1)},isMinuteAvailable:function(e){var a=t(this.currentDate);return a.minute(e).second(0),this.isAfterMinDate(a,!0,!0)&&this.isBeforeMaxDate(a,!0,!0)},start:function(){this.currentView=a.DATE,this.params.date?this.initDate():this.params.time&&this.initHours()},today:function(){var e=this.params.minuteSteps,a=t(),i=e*Math.round(a.minute()/e);i>=60&&(i=60-e),this.selectDate(t(a).minutes(i))},ok:function(){switch(this.currentView){case a.DATE:!0===this.params.time?this.initHours():this.hide(!0);break;case a.HOUR:!0===this.params.minutes?this.initMinutes():this.hide(!0);break;case a.MINUTE:this.hide(!0)}},cancel:function(){if(this.params.time)switch(this.currentView){case a.DATE:this.hide();break;case a.HOUR:this.params.date?this.initDate():this.hide();break;case a.MINUTE:this.initHours()}else this.hide()},selectMonthBefore:function(){this.calendarStart.subtract(1,"months")},selectMonthAfter:function(){this.calendarStart.add(1,"months")},selectYearBefore:function(){this.calendarStart.subtract(1,"years")},selectYearAfter:function(){this.calendarStart.add(1,"years")},selectAM:function(){(this.isHourAvailable(0)||this.isHourAvailable(12))&&(this.currentDate.hour()>=12&&this.selectDate(this.currentDate.subtract(12,"hours")),this.isHourAvailable(this.currentDate.hour())||this.selectDate(this.currentDate.hour(this.minDate.hour())),this.isMinuteAvailable(this.currentDate.minute())||this.selectDate(this.currentDate.minute(this.minDate.minute())))},selectPM:function(){(this.isHourAvailable(13)||this.isHourAvailable(24))&&(this.currentDate.hour()<12&&this.selectDate(this.currentDate.add(12,"hours")),this.isHourAvailable(this.currentDate.hour())||this.selectDate(this.currentDate.hour(this.maxDate.hour())),this.isMinuteAvailable(this.currentDate.minute())||this.selectDate(this.currentDate.minute(this.maxDate.minute())))},convertHours:function(t){var e=t;return t<12&&this.isPM()&&(e+=12),e},hide:function(t){t?this._dialog.hide(this.currentDate):this._dialog.cancel()}},angular.module(e).directive("mdcDatetimePickerCalendar",[function(){for(var e=12*((new Date).getFullYear()+30-1920+1),a=[],i=0;i6&&(i=0),t.push(i.toString());if(s.week=t,n.maxDate||n.minDate){var o=n.minDate?r(n.minDate):0,c=n.maxDate?r(n.maxDate)+1:e;s.months=a.slice(o,c)}else s.months=a;s.topIndex=r(n.currentDate)-s.months[0]},1===angular.version.major&&angular.version.minor<5&&this.$onInit(),s.getItemAtIndex=function(e){var a=(e+1)%12||12,i=1920+Math.floor(e/12),r=t(n.currentDate).year(i).month(a);return o(r)},i.$watch(function(){return n.currentDate?n.currentDate.format("YYYY-MM"):""},function(e,a){if(e!=a){var i=t(e,"YYYY-MM"),o=n.minDate?r(n.minDate):0,c=r(i,o);s.topIndex!=c&&(s.topIndex=c)}});var o=function(e){var a={};if(null!==e){a.name=e.format("MMMM YYYY");var i=t(e).locale(n.params.lang).startOf("month").hour(e.hour()).minute(e.minute()),r=i.format("d");a.days=[];for(var o=i.date();o<=i.daysInMonth();o++){if(o===i.date()){var c=s.week.indexOf(r.toString());if(c>0)for(var l=0;l
'}}]).directive("mdcDatetimePickerCalendarMonth",["$compile",function(t){var e=function(e,a){var i=angular.element(e[0].querySelector("tbody")),r=a.cal,n=[];a.month.days.forEach(function(t,e){n.push(""),t.forEach(function(t,a){if(n.push(""),t)if(r.isInRange(t)){var i="month['days']["+e+"]["+a+"]";n.push(''),n.push(t.format("D")),n.push("")}else n.push(''),n.push(t.format("D")),n.push("");n.push("")}),n.push("")}),i.html(n.join("")),t(i)(a)};return{scope:{idx:"="},require:"^mdcDatetimePickerCalendar",restrict:"AE",template:'
{{month.name}}
{{cal.toDay(day)}}
',link:function(t,a,i,r){t.cal=r,t.month=r.getItemAtIndex(parseInt(t.idx)),e(a,t),t.$watch(function(){return t.idx},function(i,n){i!=n&&(t.month=r.getItemAtIndex(parseInt(t.idx)),e(a,t))})}}}]),angular.module(e).directive("mdcDtpNoclick",function(){return{link:function(t,e){e.on("click",function(t){t.preventDefault()})}}}),angular.module(e).directive("mdcDatetimePickerClock",["$timeout",function(t){return{restrict:"E",template:'',link:function(e,a,r){var n="minutes"===r.mode,s=e.picker,o=document.querySelector("md-dialog.dtp"),c=function(t,e){var a=0;if(0!==(t=t>=360?0:t)){var i=n?60:12;a=Math.round(i/360*t)}if(n){var r=s.params.minuteSteps;(r<1||r>59)&&(r=1);var o=r*Math.round(a/r);o>=60&&(o=60-r),s.currentDate.minute(o)}else 12===a&&(a=0),s.params.shortTime||(s.meridien=e>84?"AM":"PM"),s.currentDate.hour(s.isPM()?a+12:a);s.currentDate.second(0)},l="ontouchstart"in window,d={POINTER_DOWN:l?"touchstart":"mousedown",POINTER_UP:l?"touchend":"mouseup",POINTER_MOVE:l?"touchmove":"mousemove"},u=function(e){e.preventDefault();var a=e.currentTarget.closest("div"),i=a.getClientRects()[0];l&&(e=e.changedTouches[0]);var r=a.offsetWidth/2-(e.pageX-i.left),n=e.pageY-i.top-a.offsetHeight/2,s=Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),o=Math.round(Math.atan2(r,n)*(180/Math.PI));t(function(){c(o+180,s)})};a.on(d.POINTER_DOWN,function(){a.on(d.POINTER_MOVE,u)}),a.on(d.POINTER_UP,function(){a.off(d.POINTER_MOVE)}),e.$on("$destroy",function(){a.off(d.POINTER_MOVE,u)});var m=function(){var t=angular.element(a[0].querySelector(".dtp-picker-clock")),c=angular.element(o.querySelector(".dtp-picker")),l=o.querySelector(".dtp-content").offsetWidth,d=parseInt(i(c,"paddingLeft").replace("px",""))||0,u=parseInt(i(c,"paddingRight").replace("px",""))||0,m=l-((parseInt(i(t,"marginLeft").replace("px",""))||0)+(parseInt(i(t,"marginRight").replace("px",""))||0)+d+u);t.css("width",m+"px");for(var h=parseInt(i(c,"paddingLeft").replace("px",""))||0,v=parseInt(i(c,"paddingTop").replace("px",""))||0,D=parseInt(i(t,"marginLeft").replace("px",""))||0,g=parseInt(i(t,"marginTop").replace("px",""))||0,k=m/2,M=k/1.2,y=[],x=0;x<12;++x){var b=k+M*Math.sin(2*Math.PI*(x/12))+h/2-(h+D),T=k-M*Math.cos(2*Math.PI*(x/12))-g/2-(v+g),w={left:b,top:T,value:n?5*x:x,style:{"margin-left":b+"px","margin-top":T+"px"}};n?w.display=w.value<10?"0"+w.value:w.value:s.params.shortTime?w.display=0===x?12:x:w.display=x,y.push(w)}if(e.points=y,!s.params.shortTime&&!n){for(var I=[],A=k/1.8,P=12;P<24;++P){var S=k+A*Math.sin(2*Math.PI*(P/12))+h/2-(h+D),Y=k-A*Math.cos(2*Math.PI*(P/12))-g/2-(v+g),O={left:S,top:Y,value:P,style:{"margin-left":S+"px","margin-top":Y+"px"}};O.display=P,I.push(O)}e.points24=I}e.mode=r.mode,f(),t.css("height",m+"px");var V=a[0].querySelector(".dtp-clock-center"),E=V.offsetWidth/2||7.5,H=V.offsetHeight/2||7.5,N=k/(s.params.shortTime?1.8:2.3),C=k/1.5;angular.element(a[0].querySelector(".dtp-hour-hand")).css({left:k+1.5*D+"px",height:N+"px",marginTop:k-N-h+"px"}).addClass(n?"":"on"),angular.element(a[0].querySelector(".dtp-minute-hand")).css({left:k+1.5*D+"px",height:C+"px",marginTop:k-C-h+"px"}).addClass(n?"on":""),angular.element(V).css({left:k+h+D-E+"px",marginTop:k-D/2-H+"px"}),p()},p=function(){var t=s.currentNearestMinute(),e=t.hour(),i=t.minute();h(angular.element(a[0].querySelector(".dtp-hour-hand")),30*e),h(angular.element(a[0].querySelector(".dtp-minute-hand")),6*i)},h=function(t,e){angular.element(t).css({WebkitTransform:"rotate("+e+"deg)","-moz-transform":"rotate("+e+"deg)","-ms-transform":"rotate("+e+"deg)",transform:"rotate("+e+"deg)"})},f=function(){var t=s.currentNearestMinute(),a=s.params.shortTime?12:24;e.currentValue=n?t.minute():t.hour()%a};e.$watch(function(){var t=s.currentNearestMinute();return t?t.format("HH:mm"):""},function(){f(),p()}),e.setTime=function(t){n?(t===e.currentValue&&s.ok(),s.currentDate.minute(t)):(t!==e.currentValue||s.params.autoOk||s.ok(),s.params.shortTime?s.currentDate.hour(s.isPM()?t+12:t):(s.currentDate.hour(t),s.meridien=t>=12?"PM":"AM"),s.params.autoOk&&s.ok()),s.currentDate.second(0)},e.pointAvailable=function(t){return n?s.isMinuteAvailable(t.value):s.isHourAvailable(t.value)};var v=e.$watch(function(){return a[0].querySelectorAll("div").length},function(){m(),v()})}}}]),e}var e=window&&window.process&&window.process.type;"function"==typeof define&&define.amd?define(["moment"],t):"undefined"!=typeof module&&module&&module.exports&&"function"==typeof require&&!e?module.exports=t(require("moment")):t(("undefined"!=typeof global?global:window).moment)}(); //# sourceMappingURL=angular-material-datetimepicker.min.js.map diff --git a/dist/angular-material-datetimepicker.min.js.map b/dist/angular-material-datetimepicker.min.js.map index 99670cf..30e9760 100644 --- a/dist/angular-material-datetimepicker.min.js.map +++ b/dist/angular-material-datetimepicker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["angular-material-datetimepicker.js"],"names":["ngMaterialDatePicker","moment","moduleName","VIEW_STATES","DATE","HOUR","MINUTE","css","el","name","angular","element","window","getComputedStyle","template","module","provider","this","locale","navigator","userLanguage","language","$get","setDefaultLocale","localeString","factory","mdcDatetimePickerDefaultLocale","date","time","minutes","format","minDate","maxDate","currentDate","lang","weekStart","shortTime","cancelText","okText","amText","pmText","todayText","disableDates","disableParentScroll","autoOk","editInput","clickOutsideToClose","minuteSteps","directive","$mdDialog","$timeout","restrict","require","scope","ngChange","showTodaysDate","link","attrs","ngModel","isOn","dateOfTheDay","undefined","isString","$options","createChild","*","debounce","$formatters","push","value","m","isValid","$parsers","_d","on","e","preventDefault","blur","parent","removeClass","options","i","hasOwnProperty","isUndefined","locals","show","controller","PluginController","controllerAs","openFrom","document","body","bindToController","hasBackDrop","skipHide","multiple","then","v","isSame","$q","mdcDefaultParams","accepted_options","Object","keys","deferred","defer","copy","indexOf","resolve","reject","promise","$scope","currentView","_dialog","_attachedEvents","VIEWS","params","meridien","extend","init","$inject","prototype","timeMode","dateMode","initDates","start","currentNearestMinute","nearestMin","Math","round","minute","that","_dateParam","input","fallback","ret","isDefined","isDate","x","getTime","_isAMomentObject","map","selectDate","initDate","initHours","initMinutes","isAfterMinDate","checkHour","checkMinute","_return","_minDate","_date","hour","second","millisecond","parseInt","isBeforeMaxDate","checkTime","_maxDate","isInDisableDates","dut","calendarStart","setName","text","possible","charAt","floor","random","length","isPM","incrementMonth","amount","isNextMonthVisible","add","isPreviousMonthVisible","incrementYear","isNextYearVisible","isPreviousYearVisible","startOf","endOf","isHourAvailable","convertHours","isMinuteAvailable","today","ok","hide","cancel","selectMonthBefore","subtract","selectMonthAfter","selectYearBefore","selectYearAfter","selectAM","selectPM","h","okBtn","MONTHS_IN_ALL","Date","getFullYear","MONTHS","currentMonthIndex","low","year","month","picker","calendar","$onInit","days","toString","week","high","months","slice","topIndex","version","major","minor","getItemAtIndex","index","monthObj","generateMonthCalendar","$watch","val2","val1","nDate","startOfMonth","iNumDay","daysInMonth","iWeek","daysTmp","slices","ceil","j","toDay","substring","isInRange","isSelectedDay","isDateOfTheDay","$compile","buildCalendarContent","tbody","querySelector","cal","tbodyHtml","forEach","weekDays","weekDay","scopeRef","html","join","idx","oldIdx","minuteMode","mode","componentRoot","setTimeDegRay","deg","ray","val","divider","isTouchSupported","EVENTS","POINTER_DOWN","POINTER_UP","POINTER_MOVE","onMoveEvent","closestTarget","currentTarget","closest","clientRect","getClientRects","changedTouches","offsetWidth","pageX","left","y","pageY","top","offsetHeight","sqrt","pow","atan2","PI","off","$on","exec","clock","pickerEl","w","pl","replace","pr","clockWidth","pL","pT","mL","mT","r","points","sin","cos","style","margin-left","margin-top","display","points24","j24","h24","left24","top24","hour24","setCurrentValue","clockCenter","centerWidth","centerHeight","_hL","_mL","height","marginTop","addClass","animateHands","rotateElement","WebkitTransform","-moz-transform","-ms-transform","transform","nbH","currentValue","tmp","setTime","pointAvailable","point","unWatcher","querySelectorAll","isElectron","process","type","define","amd","exports","global"],"mappings":"CAAA,WACE,aAEF,SAASA,EAAqBC,GAC5B,IAAIC,EAAa,uBAEbC,GACFC,KAAM,EACNC,KAAM,EACNC,OAAQ,GAGNC,EAAM,SAAUC,EAAIC,GAEtB,OADAD,EAAKE,QAAQC,QAAQH,GACb,qBAAsBI,OAAUA,OAAOC,iBAAiBL,EAAG,IAAIC,GAAQD,EAAGD,IAAIE,IAGpFK,EACF,srIAoDFJ,QAAQK,OAAOb,GAAa,eACzBc,SAAS,iCAAkC,WAC1CC,KAAKC,OAASN,OAAOO,UAAUC,cAAgBR,OAAOO,UAAUE,UAAY,KAE5EJ,KAAKK,KAAO,WACV,OAAOL,MAGTA,KAAKM,iBAAmB,SAAUC,GAChCP,KAAKC,OAASM,KAGjBC,QAAQ,oBAAqB,iCAAkC,SAAUC,GAwBxE,OAtBEC,MAAM,EACNC,MAAM,EACNC,SAAS,EACTC,OAAQ,aACRC,QAAS,KACTC,QAAS,KACTC,YAAa,KACbC,KAAMR,EAA+BR,OACrCiB,UAAW,EACXC,WAAW,EACXC,WAAY,SACZC,OAAQ,KACRC,OAAQ,KACRC,OAAQ,KACRC,UAAW,QACXC,gBACAC,qBAAqB,EACrBC,QAAQ,EACRC,WAAW,EACXC,qBAAqB,EACrBC,YAAa,MAIhBC,UAAU,qBAAsB,YAAa,WAC5C,S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OAAUyF,EAAM,GAAMA,IAErDtD,EAAO3K,YAAYuH,KAAK0G,GACTtD,EAAOvF,SAAlB6I,GAAO,GAAsB,KACV,MAGrBtD,EAAOxF,OAAOxE,QAChBgK,EAAOpB,MASXoB,EAAO3K,YAAYwH,OAAO,IAG5BpG,EAAMqR,eAAiB,SAAUC,GAC/B,OAAO/E,EAAahD,EAAOtB,kBAAkBqJ,EAAMtQ,OAASuI,EAAOxB,gBAAgBuJ,EAAMtQ,QAG3F,IAAIuQ,EAAYvR,EAAMwK,OAAO,WAC3B,OAAOlN,EAAQ,GAAGkU,iBAAiB,OAAOrK,QACzC,WACDqH,IACA+C,WAKH1U,EAGT,IAAI4U,EAAalU,QAAUA,OAAOmU,SAAWnU,OAAOmU,QAAQC,KACtC,mBAAXC,QAAyBA,OAAOC,IACzCD,QAAQ,UAAWjV,GACQ,oBAAXe,QAA0BA,QAAUA,OAAOoU,SAA+B,mBAAZ/R,UAA4B0R,EAC1G/T,OAAOoU,QAAUnV,EAAqBoD,QAAQ,WAE9CpD,GAAwC,oBAAXoV,OAAyBA,OAASxU,QAAQX","file":"angular-material-datetimepicker.min.js","sourcesContent":["(function () {\r\n 'use strict';\r\n\r\nfunction ngMaterialDatePicker(moment) {\r\n var moduleName = \"ngMaterialDatePicker\";\r\n\r\n var VIEW_STATES = {\r\n DATE: 0,\r\n HOUR: 1,\r\n MINUTE: 2\r\n };\r\n\r\n var css = function (el, name) {\r\n el = angular.element(el);\r\n return ('getComputedStyle' in window) ? window.getComputedStyle(el[0])[name] : el.css(name);\r\n };\r\n\r\n var template = \r\n '' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentNearestMinute().format(\"dddd\")}}
' +\r\n '
{{picker.params.shortTime ? picker.currentDate.format(\"A\") : \" \"}}
' +\r\n '
' +\r\n ' ×' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"MMM\") | uppercase}}
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"DD\")}}
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"YYYY\")}}
' +\r\n '
' +\r\n '
'+\r\n '
' + //start time \r\n '
' +\r\n '
{{picker.currentNearestMinute().format(picker.params.shortTime ? \"hh:mm\" : \"HH:mm\")}} {{picker.currentDate.format(\"A\")}}
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' {{picker.params.amText}}' +\r\n '
' +\r\n '
{{picker.currentNearestMinute().format(picker.params.shortTime ? \"hh:mm\" : \"HH:mm\")}}
' +\r\n '
' +\r\n ' {{picker.params.pmText}}' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n ' {{picker.params.todayText}}' +\r\n ' {{picker.params.cancelText}}' +\r\n ' {{picker.params.okText}}' +\r\n ' ' +\r\n '
';\r\n\r\n angular.module(moduleName, ['ngMaterial'])\r\n .provider('mdcDatetimePickerDefaultLocale', function () {\r\n this.locale = window.navigator.userLanguage || window.navigator.language || 'en';\r\n\r\n this.$get = function () {\r\n return this;\r\n };\r\n\r\n this.setDefaultLocale = function (localeString) {\r\n this.locale = localeString;\r\n };\r\n })\r\n .factory('mdcDefaultParams', ['mdcDatetimePickerDefaultLocale', function (mdcDatetimePickerDefaultLocale) {\r\n var default_params = {\r\n date: true,\r\n time: true,\r\n minutes: true,\r\n format: 'YYYY-MM-DD',\r\n minDate: null,\r\n maxDate: null,\r\n currentDate: null,\r\n lang: mdcDatetimePickerDefaultLocale.locale,\r\n weekStart: 0,\r\n shortTime: false,\r\n cancelText: 'Cancel',\r\n okText: 'OK',\r\n amText: 'AM',\r\n pmText: 'PM',\r\n todayText: 'Today',\r\n disableDates: [],\r\n disableParentScroll: false,\r\n autoOk: false,\r\n editInput: false,\r\n clickOutsideToClose: false,\r\n minuteSteps: 5\r\n };\r\n return default_params;\r\n }])\r\n .directive('mdcDatetimePicker', ['$mdDialog', '$timeout',\r\n function ($mdDialog, $timeout) {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n scope: {\r\n currentDate: '=ngModel',\r\n ngChange: '&',\r\n time: '=',\r\n date: '=',\r\n minutes: '=',\r\n minDate: '=',\r\n maxDate: '=',\r\n disableDates: '=',\r\n shortTime: '=',\r\n weekStart: '=',\r\n format: '@',\r\n cancelText: '@',\r\n okText: '@',\r\n lang: '@',\r\n amText: '@',\r\n pmText: '@',\r\n showTodaysDate: '@',\r\n todayText: '@',\r\n disableParentScroll: '=',\r\n autoOk: '=',\r\n editInput: '=',\r\n clickOutsideToClose: '=',\r\n minuteSteps: '='\r\n },\r\n link: function (scope, element, attrs, ngModel) {\r\n var isOn = false;\r\n if (!scope.format) {\r\n if (scope.date && scope.time) {\r\n scope.format = 'YYYY-MM-DD HH:mm';\r\n } else if (scope.date) {\r\n scope.format = 'YYYY-MM-DD';\r\n } else {\r\n scope.format = 'HH:mm';\r\n }\r\n }\r\n\r\n var dateOfTheDay = null;\r\n if (scope.showTodaysDate !== undefined && scope.showTodaysDate !== \"false\") {\r\n dateOfTheDay = moment();\r\n }\r\n\r\n if (angular.isString(scope.currentDate) && scope.currentDate !== '') {\r\n scope.currentDate = moment(scope.currentDate, scope.format);\r\n }\r\n\r\n if (ngModel) {\r\n ngModel.$options = ngModel.$options.createChild({\r\n '*': '$inherit',\r\n debounce: 500\r\n });\r\n ngModel.$formatters.push(function (value) {\r\n if (typeof value === 'undefined') return;\r\n var m = moment(value);\r\n return m.isValid() ? m.format(scope.format) : '';\r\n });\r\n \r\n ngModel.$parsers.push(function (value) {\r\n if (typeof value === 'undefined') return;\r\n var m = moment(value, scope.format);\r\n if (m.isValid()) return m._d;\r\n return;\r\n });\r\n \r\n }\r\n\r\n //@TODO custom event to trigger input\r\n if (!scope.editInput) {\r\n element.on('focus', function (e) {\r\n e.preventDefault();\r\n element.blur();\r\n element.parent().removeClass('md-input-focused');\r\n if (isOn) {\r\n return;\r\n }\r\n isOn = true;\r\n var options = {};\r\n for (var i in attrs) {\r\n if (scope.hasOwnProperty(i) && !angular.isUndefined(scope[i])) {\r\n options[i] = scope[i];\r\n }\r\n }\r\n options.currentDate = scope.currentDate;\r\n options.showTodaysDate = dateOfTheDay;\r\n\r\n var locals = {options: options};\r\n $mdDialog.show({\r\n template: template,\r\n controller: PluginController,\r\n controllerAs: 'picker',\r\n locals: locals,\r\n openFrom: element,\r\n parent: angular.element(document.body),\r\n bindToController: true,\r\n clickOutsideToClose: options.clickOutsideToClose || false,\r\n disableParentScroll: options.disableParentScroll || false,\r\n hasBackDrop: false,\r\n skipHide: true,\r\n multiple: true\r\n })\r\n .then(function (v) {\r\n scope.currentDate = v ? v._d : v;\r\n isOn = false;\r\n\r\n if (!moment(scope.currentDate).isSame(options.currentDate)) {\r\n $timeout(scope.ngChange, 0);\r\n }\r\n\r\n element.parent().removeClass('md-input-focused');\r\n\r\n }, function () {\r\n isOn = false;\r\n element.parent().removeClass('md-input-focused');\r\n })\r\n ;\r\n });\r\n }\r\n }\r\n };\r\n }])\r\n /** Returns a service that opens a dialog when the attribute shown is called\r\n The dialog serves to select a date/time/etc. depending on the options given to the function show\r\n\r\n @param options extends mdcDefaultParams\r\n {\r\n date: {boolean} =true,\r\n time: {boolean} =true,\r\n minutes: {boolean} =true,\r\n format: {string} ='YYYY-MM-DD',\r\n minDate: {strign} =null,\r\n maxDate: {string} =null,\r\n currentDate: {string} =null,\r\n lang: {string} =mdcDatetimePickerDefaultLocale,\r\n weekStart: {int} =0,\r\n shortTime: {boolean} =false,\r\n cancelText: {string} ='Cancel',\r\n showTodaysDate: {string} ='',\r\n todayText: {string} ='Today',\r\n okText: {string} ='OK',\r\n amText: {string} ='AM',\r\n pmText: {string} ='PM',\r\n disableDates: {date[]} =[],\r\n disableParentScroll: {boolean} =false,\r\n autoOk: {boolean} =false,\r\n editInput: {boolean} =false,\r\n clickOutsideToClose: {boolean} =false,\r\n minuteSteps: {int} =5\r\n }\r\n @return promise\r\n */\r\n .factory('mdcDateTimeDialog', [\"$mdDialog\", \"$q\", \"mdcDefaultParams\", function ($mdDialog, $q, mdcDefaultParams) {\r\n var accepted_options = Object.keys(mdcDefaultParams);\r\n var service = {\r\n show: function (options) {\r\n var deferred = $q.defer();\r\n var params = angular.copy(mdcDefaultParams);\r\n for (var i in options) {\r\n if (accepted_options.indexOf[i] != -1 && options.hasOwnProperty(i)) {\r\n params = options[i];\r\n }\r\n }\r\n\r\n var dateOfTheDay = null;\r\n if (options.showTodaysDate !== undefined && options.showTodaysDate !== \"false\") {\r\n dateOfTheDay = moment();\r\n }\r\n options.showTodaysDate = dateOfTheDay;\r\n\r\n var locals = {options: options};\r\n $mdDialog.show({\r\n template: template,\r\n controller: PluginController,\r\n controllerAs: 'picker',\r\n locals: locals,\r\n parent: angular.element(document.body),\r\n bindToController: true,\r\n clickOutsideToClose: options.clickOutsideToClose || false,\r\n disableParentScroll: options.disableParentScroll || false,\r\n skipHide: true,\r\n multiple: true\r\n })\r\n .then(function (v) {\r\n var currentDate = v ? v._d : v;\r\n deferred.resolve(v ? v._d : v);\r\n }, function () {\r\n deferred.reject();\r\n });\r\n return deferred.promise;\r\n }\r\n };\r\n\r\n return service;\r\n }])\r\n ;\r\n\r\n var PluginController = function ($scope, $mdDialog, mdcDefaultParams) {\r\n this.currentView = VIEW_STATES.DATE;\r\n this._dialog = $mdDialog;\r\n\r\n this._attachedEvents = [];\r\n this.VIEWS = VIEW_STATES;\r\n this.params = angular.copy(mdcDefaultParams);\r\n this.meridien = 'AM';\r\n this.params = angular.extend(this.params, this.options);\r\n\r\n this.init();\r\n };\r\n\r\n PluginController.$inject = ['$scope', '$mdDialog', 'mdcDefaultParams'];\r\n PluginController.prototype = {\r\n init: function () {\r\n this.timeMode = this.params.time && !this.params.date;\r\n this.dateMode = this.params.date;\r\n this.initDates();\r\n this.start();\r\n },\r\n currentNearestMinute: function () {\r\n var nearestMin = this.params.minuteSteps;\r\n if (nearestMin < 1 || nearestMin > 59) nearestMin = 1;\r\n\r\n var date = this.currentDate || moment();\r\n var minutes = (nearestMin * Math.round(date.minute() / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n return moment(date).minutes(minutes);\r\n },\r\n initDates: function () {\r\n var that = this;\r\n var _dateParam = function (input, fallback) {\r\n var ret = null;\r\n if (angular.isDefined(input) && input !== null && input !== '') {\r\n if (angular.isString(input)) {\r\n if (typeof(that.params.format) !== 'undefined' && that.params.format !== null) {\r\n ret = moment(input, that.params.format).locale(that.params.lang);\r\n }\r\n else {\r\n ret = moment(input).locale(that.params.lang);\r\n }\r\n } else if (typeof input === 'number') {\r\n ret = moment(input).locale(that.params.lang);\r\n } else {\r\n if (angular.isDate(input)) {\r\n var x = input.getTime();\r\n ret = moment(x, \"x\").locale(that.params.lang);\r\n } else if (input._isAMomentObject) {\r\n ret = input;\r\n }\r\n }\r\n }\r\n else {\r\n ret = fallback;\r\n }\r\n return ret;\r\n };\r\n\r\n this.currentDate = _dateParam(this.params.currentDate, moment());\r\n this.minDate = _dateParam(this.params.minDate);\r\n this.maxDate = _dateParam(this.params.maxDate);\r\n this.disableDates = this.params.disableDates.map(function (x) {\r\n return moment(x).format('MMMM Do YYYY');\r\n });\r\n this.selectDate(this.currentDate);\r\n },\r\n initDate: function () {\r\n this.currentView = VIEW_STATES.DATE;\r\n },\r\n initHours: function () {\r\n this.currentView = VIEW_STATES.HOUR;\r\n },\r\n initMinutes: function () {\r\n this.currentView = VIEW_STATES.MINUTE;\r\n },\r\n isAfterMinDate: function (date, checkHour, checkMinute) {\r\n var _return = true;\r\n\r\n if (typeof(this.minDate) !== 'undefined' && this.minDate !== null) {\r\n var _minDate = moment(this.minDate);\r\n var _date = moment(date);\r\n\r\n if (!checkHour && !checkMinute) {\r\n _minDate.hour(0);\r\n _minDate.minute(0);\r\n\r\n _date.hour(0);\r\n _date.minute(0);\r\n }\r\n\r\n _minDate.second(0);\r\n _date.second(0);\r\n _minDate.millisecond(0);\r\n _date.millisecond(0);\r\n\r\n if (!checkMinute) {\r\n _date.minute(0);\r\n _minDate.minute(0);\r\n\r\n _return = (parseInt(_date.format(\"X\")) >= parseInt(_minDate.format(\"X\")));\r\n }\r\n else {\r\n _return = (parseInt(_date.format(\"X\")) >= parseInt(_minDate.format(\"X\")));\r\n }\r\n }\r\n\r\n return _return;\r\n },\r\n isBeforeMaxDate: function (date, checkTime, checkMinute) {\r\n var _return = true;\r\n\r\n if (typeof(this.maxDate) !== 'undefined' && this.maxDate !== null) {\r\n var _maxDate = moment(this.maxDate);\r\n var _date = moment(date);\r\n\r\n if (!checkTime && !checkMinute) {\r\n _maxDate.hour(0);\r\n _maxDate.minute(0);\r\n\r\n _date.hour(0);\r\n _date.minute(0);\r\n }\r\n\r\n _maxDate.second(0);\r\n _date.second(0);\r\n _maxDate.millisecond(0);\r\n _date.millisecond(0);\r\n\r\n if (!checkMinute) {\r\n _date.minute(0);\r\n _maxDate.minute(0);\r\n\r\n _return = (parseInt(_date.format(\"X\")) <= parseInt(_maxDate.format(\"X\")));\r\n }\r\n else {\r\n _return = (parseInt(_date.format(\"X\")) <= parseInt(_maxDate.format(\"X\")));\r\n }\r\n }\r\n\r\n return _return;\r\n },\r\n isInDisableDates: function (date) {\r\n var dut = date.format('MMMM Do YYYY');\r\n if (this.disableDates.indexOf(dut) > -1) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n selectDate: function (date) {\r\n if (date) {\r\n this.currentDate = moment(date);\r\n if (!this.isAfterMinDate(this.currentDate)) {\r\n this.currentDate = moment(this.minDate);\r\n }\r\n\r\n if (!this.isBeforeMaxDate(this.currentDate)) {\r\n this.currentDate = moment(this.maxDate);\r\n }\r\n this.currentDate.locale(this.params.lang);\r\n this.calendarStart = moment(this.currentDate);\r\n this.meridien = this.currentDate.hour() >= 12 ? 'PM' : 'AM';\r\n }\r\n },\r\n setName: function () {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < 5; i++) {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n\r\n return text;\r\n },\r\n isPM: function () {\r\n return this.meridien === 'PM';\r\n },\r\n incrementMonth: function (amount) {\r\n if (amount === 1 && this.isNextMonthVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'month'));\r\n }\r\n\r\n if (amount === -1 && this.isPreviousMonthVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'month'));\r\n }\r\n },\r\n incrementYear: function (amount) {\r\n if (amount === 1 && this.isNextYearVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'year'));\r\n }\r\n\r\n if (amount === -1 && this.isPreviousYearVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'year'));\r\n }\r\n },\r\n isPreviousMonthVisible: function () {\r\n return this.calendarStart && this.isAfterMinDate(moment(this.calendarStart).startOf('month'), false, false);\r\n },\r\n isNextMonthVisible: function () {\r\n return this.calendarStart && this.isBeforeMaxDate(moment(this.calendarStart).endOf('month'), false, false);\r\n },\r\n isPreviousYearVisible: function () {\r\n return this.calendarStart && this.isAfterMinDate(moment(this.calendarStart).startOf('year'), false, false);\r\n },\r\n isNextYearVisible: function () {\r\n return this.calendarStart && this.isBeforeMaxDate(moment(this.calendarStart).endOf('year'), false, false);\r\n },\r\n isHourAvailable: function (hour) {\r\n var _date = moment(this.currentDate);\r\n if (this.params.shortTime) {\r\n _date.hour(this.convertHours(hour)).minute(0).second(0);\r\n } else {\r\n _date.hour(hour).minute(0).second(0);\r\n }\r\n return this.isAfterMinDate(_date, true, false) && this.isBeforeMaxDate(_date, true, false);\r\n },\r\n isMinuteAvailable: function (minute) {\r\n var _date = moment(this.currentDate);\r\n _date.minute(minute).second(0);\r\n return this.isAfterMinDate(_date, true, true) && this.isBeforeMaxDate(_date, true, true);\r\n },\r\n start: function () {\r\n this.currentView = VIEW_STATES.DATE;\r\n if (this.params.date) {\r\n this.initDate();\r\n } else {\r\n if (this.params.time) {\r\n this.initHours();\r\n }\r\n }\r\n },\r\n today: function () {\r\n var nearestMin = this.params.minuteSteps;\r\n var date = moment();\r\n var minutes = (nearestMin * Math.round(date.minute() / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n this.selectDate(moment(date).minutes(minutes));\r\n },\r\n ok: function () {\r\n switch (this.currentView) {\r\n case VIEW_STATES.DATE:\r\n if (this.params.time === true) {\r\n this.initHours();\r\n } else {\r\n this.hide(true);\r\n }\r\n break;\r\n case VIEW_STATES.HOUR:\r\n if (this.params.minutes === true) {\r\n this.initMinutes();\r\n } else {\r\n this.hide(true);\r\n }\r\n break;\r\n case VIEW_STATES.MINUTE:\r\n this.hide(true);\r\n break;\r\n }\r\n },\r\n cancel: function () {\r\n if (this.params.time) {\r\n switch (this.currentView) {\r\n case VIEW_STATES.DATE:\r\n this.hide();\r\n break;\r\n case VIEW_STATES.HOUR:\r\n if (this.params.date) {\r\n this.initDate();\r\n }\r\n else {\r\n this.hide();\r\n }\r\n break;\r\n case VIEW_STATES.MINUTE:\r\n this.initHours();\r\n break;\r\n }\r\n }\r\n else {\r\n this.hide();\r\n }\r\n },\r\n selectMonthBefore: function () {\r\n this.calendarStart.subtract(1, 'months');\r\n },\r\n selectMonthAfter: function () {\r\n this.calendarStart.add(1, 'months');\r\n },\r\n selectYearBefore: function () {\r\n this.calendarStart.subtract(1, 'years');\r\n },\r\n selectYearAfter: function () {\r\n this.calendarStart.add(1, 'years');\r\n },\r\n selectAM: function () {\r\n if (this.isHourAvailable(0) || this.isHourAvailable(12)) {\r\n if (this.currentDate.hour() >= 12) {\r\n this.selectDate(this.currentDate.subtract(12, 'hours'));\r\n }\r\n if (!this.isHourAvailable(this.currentDate.hour())) {\r\n this.selectDate(this.currentDate.hour(this.minDate.hour()));\r\n }\r\n if (!this.isMinuteAvailable(this.currentDate.minute())) {\r\n this.selectDate(this.currentDate.minute(this.minDate.minute()));\r\n }\r\n }\r\n },\r\n selectPM: function () {\r\n if (this.isHourAvailable(13) || this.isHourAvailable(24)) {\r\n if (this.currentDate.hour() < 12) {\r\n this.selectDate(this.currentDate.add(12, 'hours'));\r\n }\r\n if (!this.isHourAvailable(this.currentDate.hour())) {\r\n this.selectDate(this.currentDate.hour(this.maxDate.hour()));\r\n }\r\n if (!this.isMinuteAvailable(this.currentDate.minute())) {\r\n this.selectDate(this.currentDate.minute(this.maxDate.minute()));\r\n }\r\n }\r\n },\r\n convertHours: function (h) {\r\n var _return = h;\r\n if ((h < 12) && this.isPM())\r\n _return += 12;\r\n\r\n return _return;\r\n },\r\n hide: function (okBtn) {\r\n if (okBtn) {\r\n this._dialog.hide(this.currentDate);\r\n } else {\r\n this._dialog.cancel();\r\n }\r\n }\r\n };\r\n\r\n\r\n angular.module(moduleName)\r\n .directive('mdcDatetimePickerCalendar', [\r\n function () {\r\n\r\n var YEAR_MIN = 1920,\r\n YEAR_MAX = new Date().getFullYear() + 30,\r\n MONTHS_IN_ALL = (YEAR_MAX - YEAR_MIN + 1) * 12,\r\n ITEM_HEIGHT = 240,\r\n MONTHS = [];\r\n for (var i = 0; i < MONTHS_IN_ALL; i++) {\r\n MONTHS.push(i);\r\n }\r\n\r\n var currentMonthIndex = function (date, low) {\r\n low = low ? low : 0;\r\n var year = date.year();\r\n var month = date.month();\r\n return (((year - YEAR_MIN) * 12) + month - 1 ) - low;\r\n };\r\n\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n picker: '=',\r\n date: '='\r\n },\r\n bindToController: true,\r\n controllerAs: 'cal',\r\n controller: ['$scope', function ($scope) {\r\n var calendar = this, picker;\r\n\r\n this.$onInit = function () {\r\n picker = this.picker;\r\n\r\n var days = [];\r\n for (var i = picker.params.weekStart; days.length < 7; i++) {\r\n if (i > 6) {\r\n i = 0;\r\n }\r\n days.push(i.toString());\r\n }\r\n calendar.week = days;\r\n\r\n if (!picker.maxDate && !picker.minDate) {\r\n calendar.months = MONTHS;\r\n } else {\r\n var low = picker.minDate ? currentMonthIndex(picker.minDate) : 0;\r\n var high = picker.maxDate ? (currentMonthIndex(picker.maxDate) + 1) : MONTHS_IN_ALL;\r\n calendar.months = MONTHS.slice(low, high);\r\n }\r\n\r\n calendar.topIndex = currentMonthIndex(picker.currentDate) - calendar.months[0];\r\n };\r\n\r\n if (angular.version.major === 1 && angular.version.minor < 5) {\r\n this.$onInit();\r\n }\r\n \r\n calendar.getItemAtIndex = function (index) {\r\n var month = ((index + 1) % 12) || 12;\r\n var year = YEAR_MIN + Math.floor(index / 12);\r\n var monthObj = moment(picker.currentDate).year(year).month(month);\r\n return generateMonthCalendar(monthObj);\r\n };\r\n\r\n $scope.$watch(function () {\r\n return picker.currentDate ? picker.currentDate.format('YYYY-MM') : '';\r\n }, function (val2, val1) {\r\n if (val2 != val1) {\r\n var nDate = moment(val2, 'YYYY-MM');\r\n var low = picker.minDate ? currentMonthIndex(picker.minDate) : 0;\r\n var index = currentMonthIndex(nDate, low);\r\n if (calendar.topIndex != index) {\r\n calendar.topIndex = index;\r\n }\r\n }\r\n });\r\n\r\n var generateMonthCalendar = function (date) {\r\n var month = {};\r\n if (date !== null) {\r\n month.name = date.format('MMMM YYYY');\r\n var startOfMonth = moment(date).locale(picker.params.lang).startOf('month')\r\n .hour(date.hour())\r\n .minute(date.minute());\r\n var iNumDay = startOfMonth.format('d');\r\n month.days = [];\r\n for (var i = startOfMonth.date(); i <= startOfMonth.daysInMonth(); i++) {\r\n if (i === startOfMonth.date()) {\r\n var iWeek = calendar.week.indexOf(iNumDay.toString());\r\n if (iWeek > 0) {\r\n for (var x = 0; x < iWeek; x++) {\r\n month.days.push(0);\r\n }\r\n }\r\n }\r\n month.days.push(moment(startOfMonth).locale(picker.params.lang).date(i));\r\n }\r\n\r\n var daysInAWeek = 7, daysTmp = [], slices = Math.ceil(month.days.length / daysInAWeek);\r\n for (var j = 0; j < slices; j++) {\r\n daysTmp.push(month.days.slice(j * daysInAWeek, (j + 1) * daysInAWeek));\r\n }\r\n month.days = daysTmp;\r\n return month;\r\n }\r\n\r\n };\r\n\r\n calendar.toDay = function (i) {\r\n return moment(parseInt(i), \"d\")\r\n .locale(picker.params.lang)\r\n .format(\"dd\")\r\n .substring(0, 1);\r\n };\r\n\r\n calendar.isInRange = function (date) {\r\n return picker.isAfterMinDate(moment(date), false, false) &&\r\n picker.isBeforeMaxDate(moment(date), false, false) &&\r\n picker.isInDisableDates(moment(date));\r\n };\r\n\r\n calendar.selectDate = function (date) {\r\n if (date) {\r\n if (calendar.isSelectedDay(date)) {\r\n return picker.ok();\r\n }\r\n picker.selectDate(moment(date).hour(calendar.date.hour()).minute(calendar.date.minute()));\r\n if (picker.params.autoOk) {\r\n picker.ok();\r\n }\r\n }\r\n };\r\n\r\n calendar.isSelectedDay = function (m) {\r\n return m && calendar.date.date() === m.date() && calendar.date.month() === m.month() && calendar.date.year() === m.year();\r\n };\r\n\r\n calendar.isDateOfTheDay = function (m) {\r\n var today = calendar.picker.options.showTodaysDate;\r\n if (!today) {\r\n return false;\r\n }\r\n\r\n return m && today.date() === m.date() && today.month() === m.month() && today.year() === m.year();\r\n };\r\n }],\r\n template: \r\n '' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
'\r\n };\r\n }])\r\n .directive('mdcDatetimePickerCalendarMonth', ['$compile',\r\n function ($compile) {\r\n var buildCalendarContent = function (element, scope) {\r\n var tbody = angular.element(element[0].querySelector('tbody'));\r\n var calendar = scope.cal, month = scope.month;\r\n\r\n var tbodyHtml = [];\r\n\r\n month.days.forEach(function (weekDays, i) {\r\n tbodyHtml.push('');\r\n weekDays.forEach(function (weekDay, j) {\r\n tbodyHtml.push('');\r\n if (weekDay) {\r\n if (calendar.isInRange(weekDay)) {\r\n //build a\r\n var scopeRef = 'month[\\'days\\'][' + i + '][' + j + ']';\r\n\r\n tbodyHtml.push('');\r\n tbodyHtml.push(weekDay.format('D'));\r\n tbodyHtml.push('');\r\n } else {\r\n tbodyHtml.push('');\r\n tbodyHtml.push(weekDay.format('D'));\r\n tbodyHtml.push('');\r\n }\r\n }\r\n tbodyHtml.push('');\r\n });\r\n tbodyHtml.push('');\r\n });\r\n\r\n tbody.html(tbodyHtml.join(''));\r\n $compile(tbody)(scope);\r\n };\r\n\r\n return {\r\n scope: {\r\n idx: '='\r\n },\r\n require: '^mdcDatetimePickerCalendar',\r\n restrict: 'AE',\r\n template: \r\n '
{{month.name}}
' +\r\n '' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n '
{{cal.toDay(day)}}
',\r\n link: function (scope, element, attrs, calendar) {\r\n scope.cal = calendar;\r\n scope.month = calendar.getItemAtIndex(parseInt(scope.idx));\r\n buildCalendarContent(element, scope);\r\n scope.$watch(function () {\r\n return scope.idx;\r\n }, function (idx, oldIdx) {\r\n if (idx != oldIdx) {\r\n scope.month = calendar.getItemAtIndex(parseInt(scope.idx));\r\n buildCalendarContent(element, scope);\r\n }\r\n });\r\n }\r\n };\r\n }\r\n ])\r\n ;\r\n\r\n angular.module(moduleName)\r\n .directive('mdcDtpNoclick', function () {\r\n return {\r\n link: function (scope, el) {\r\n el.on('click', function (e) {\r\n e.preventDefault();\r\n });\r\n }\r\n };\r\n });\r\n angular.module(moduleName)\r\n .directive('mdcDatetimePickerClock', ['$timeout',\r\n function ($timeout) {\r\n\r\n var template = \r\n '
 ' +\r\n '
' +\r\n ' {{point.display}}' +\r\n ' {{point.display}}' +\r\n '
' +\r\n '
' +\r\n ' {{point24.display}}' +\r\n ' {{point24.display}}' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
';\r\n\r\n return {\r\n restrict: 'E',\r\n template: template,\r\n link: function (scope, element, attrs) {\r\n var minuteMode = attrs.mode === 'minutes';\r\n var picker = scope.picker;\r\n //banking on the fact that there will only be one at a time\r\n var componentRoot = document.querySelector('md-dialog.dtp');\r\n\r\n var setTimeDegRay = function(deg, ray) {\r\n var val = 0;\r\n deg = deg >= 360 ? 0 : deg;\r\n if (deg !== 0) {\r\n var divider = minuteMode ? 60 : 12;\r\n val = Math.round(divider / 360 * deg);\r\n }\r\n\r\n if (minuteMode) {\r\n var nearestMin = picker.params.minuteSteps;\r\n if (nearestMin < 1 || nearestMin > 59) nearestMin = 1;\r\n\r\n var minutes = (nearestMin * Math.round(val / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n picker.currentDate.minute(minutes);\r\n } else {\r\n if (val === 12) val = 0;\r\n if (!picker.params.shortTime) picker.meridien = ray > 84 ? 'AM' : 'PM';\r\n picker.currentDate.hour(picker.isPM() ? val + 12 : val);\r\n }\r\n picker.currentDate.second(0);\r\n };\r\n\r\n var isTouchSupported = ('ontouchstart' in window) ? true : false,\r\n EVENTS = {\r\n POINTER_DOWN : isTouchSupported ? 'touchstart' : 'mousedown',\r\n POINTER_UP : isTouchSupported ? 'touchend' : 'mouseup',\r\n POINTER_MOVE : isTouchSupported ? 'touchmove' : 'mousemove'\r\n };\r\n\r\n var onMoveEvent = function(e) {\r\n e.preventDefault();\r\n\r\n var closestTarget = e.currentTarget.closest('div'),\r\n clientRect = closestTarget.getClientRects()[0];\r\n\r\n if (isTouchSupported) e = e.changedTouches[0];\r\n \r\n var x = ((closestTarget.offsetWidth / 2) - (e.pageX - clientRect.left)),\r\n y = ((e.pageY - clientRect.top) - (closestTarget.offsetHeight / 2));\r\n \r\n var ray = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\r\n var deg = Math.round((Math.atan2(x, y) * (180 / Math.PI)));\r\n\r\n $timeout(function() {\r\n setTimeDegRay(deg+180, ray);\r\n });\r\n };\r\n\r\n element.on(EVENTS.POINTER_DOWN, function() {\r\n element.on(EVENTS.POINTER_MOVE, onMoveEvent);\r\n });\r\n\r\n element.on(EVENTS.POINTER_UP, function() {\r\n element.off(EVENTS.POINTER_MOVE);\r\n });\r\n\r\n scope.$on(\"$destroy\", function() {\r\n element.off(EVENTS.POINTER_MOVE, onMoveEvent); \r\n });\r\n\r\n var exec = function () {\r\n var clock = angular.element(element[0].querySelector('.dtp-picker-clock')),\r\n pickerEl = angular.element(componentRoot.querySelector('.dtp-picker'));\r\n\r\n var w = componentRoot.querySelector('.dtp-content').offsetWidth;\r\n var pl = parseInt(css(pickerEl, 'paddingLeft').replace('px', '')) || 0;\r\n var pr = parseInt(css(pickerEl, 'paddingRight').replace('px', '')) || 0;\r\n var ml = parseInt(css(clock, 'marginLeft').replace('px', '')) || 0;\r\n var mr = parseInt(css(clock, 'marginRight').replace('px', '')) || 0;\r\n //set width\r\n var clockWidth = (w - (ml + mr + pl + pr));\r\n clock.css('width', (clockWidth) + 'px');\r\n\r\n var pL = parseInt(css(pickerEl, 'paddingLeft').replace('px', '')) || 0;\r\n var pT = parseInt(css(pickerEl, 'paddingTop').replace('px', '')) || 0;\r\n var mL = parseInt(css(clock, 'marginLeft').replace('px', '')) || 0;\r\n var mT = parseInt(css(clock, 'marginTop').replace('px', '')) || 0;\r\n\r\n var r = (clockWidth / 2);\r\n var j = r / 1.2; // radius for low number\r\n \r\n var points = [];\r\n\r\n for (var h = 0; h < 12; ++h) {\r\n var x = j * Math.sin(Math.PI * 2 * (h / 12));\r\n var y = j * Math.cos(Math.PI * 2 * (h / 12));\r\n var left = (r + x + pL / 2) - (pL + mL);\r\n var top = (r - y - mT / 2) - (pT + mT);\r\n\r\n var hour = {\r\n left: left,\r\n top: top,\r\n value: (minuteMode ? (h * 5) : h), //5 for minute 60/12\r\n style: {'margin-left': left + 'px', 'margin-top': top + 'px'}\r\n };\r\n\r\n if (minuteMode) {\r\n hour.display = hour.value < 10 ? ('0' + hour.value) : hour.value;\r\n } else {\r\n\r\n if (picker.params.shortTime) {\r\n hour.display = (h === 0) ? 12 : h;\r\n } else {\r\n hour.display = h;\r\n }\r\n }\r\n\r\n points.push(hour);\r\n }\r\n scope.points = points;\r\n\r\n if (!picker.params.shortTime && !minuteMode) {\r\n var points24 = [];\r\n\r\n var j24 = r / 1.8; // radius for high number\r\n for (var h24 = 12; h24 < 24; ++h24) {\r\n var x24 = j24 * Math.sin(Math.PI * 2 * (h24 / 12));\r\n var y24 = j24 * Math.cos(Math.PI * 2 * (h24 / 12));\r\n var left24 = (r + x24 + pL / 2) - (pL + mL);\r\n var top24 = (r - y24 - mT / 2) - (pT + mT);\r\n\r\n var hour24 = {\r\n left: left24,\r\n top: top24,\r\n value: h24,\r\n style: {'margin-left': left24 + 'px', 'margin-top': top24 + 'px'}\r\n };\r\n\r\n hour24.display = h24;\r\n\r\n points24.push(hour24);\r\n }\r\n scope.points24 = points24;\r\n }\r\n\r\n scope.mode = attrs.mode;\r\n setCurrentValue();\r\n clock.css('height', clockWidth + 'px');\r\n\r\n var clockCenter = element[0].querySelector('.dtp-clock-center');\r\n var centerWidth = (clockCenter.offsetWidth / 2) || 7.5,\r\n centerHeight = (clockCenter.offsetHeight / 2) || 7.5;\r\n var _hL = r / (picker.params.shortTime ? 1.8 : 2.3);\r\n var _mL = r / 1.5;\r\n\r\n angular.element(element[0].querySelector('.dtp-hour-hand')).css({\r\n left: r + (mL * 1.5) + 'px',\r\n height: _hL + 'px',\r\n marginTop: (r - _hL - pL) + 'px'\r\n }).addClass(!minuteMode ? 'on' : '');\r\n\r\n angular.element(element[0].querySelector('.dtp-minute-hand')).css\r\n ({\r\n left: r + (mL * 1.5) + 'px',\r\n height: _mL + 'px',\r\n marginTop: (r - _mL - pL) + 'px'\r\n }).addClass(minuteMode ? 'on' : '');\r\n\r\n angular.element(clockCenter).css({\r\n left: (r + pL + mL - centerWidth) + 'px',\r\n marginTop: (r - (mL / 2)) - centerHeight + 'px'\r\n });\r\n animateHands();\r\n };\r\n\r\n var animateHands = function () {\r\n var _date = picker.currentNearestMinute();\r\n var h = _date.hour();\r\n var m = _date.minute();\r\n\r\n rotateElement(angular.element(element[0].querySelector('.dtp-hour-hand')), 30 * h);\r\n rotateElement(angular.element(element[0].querySelector('.dtp-minute-hand')), 6 * m);\r\n };\r\n\r\n var rotateElement = function (el, deg) {\r\n angular.element(el).css({\r\n WebkitTransform: 'rotate(' + deg + 'deg)',\r\n '-moz-transform': 'rotate(' + deg + 'deg)',\r\n '-ms-transform': 'rotate(' + deg + 'deg)',\r\n 'transform': 'rotate(' + deg + 'deg)'\r\n });\r\n };\r\n\r\n\r\n var setCurrentValue = function () {\r\n var date = picker.currentNearestMinute();\r\n var nbH = picker.params.shortTime ? 12 : 24;\r\n scope.currentValue = minuteMode ? date.minute() : (date.hour() % nbH);\r\n };\r\n\r\n scope.$watch(function () {\r\n var tmp = picker.currentNearestMinute();\r\n return tmp ? tmp.format('HH:mm') : '';\r\n }, function () {\r\n setCurrentValue();\r\n animateHands();\r\n });\r\n\r\n scope.setTime = function (val) {\r\n if (!minuteMode) {\r\n // double click\r\n if (val === scope.currentValue && !picker.params.autoOk){\r\n picker.ok();\r\n }\r\n\r\n if (picker.params.shortTime) {\r\n picker.currentDate.hour(picker.isPM() ? (val + 12) : val);\r\n } else {\r\n picker.currentDate.hour(val);\r\n if (val >= 12) picker.meridien = 'PM';\r\n else picker.meridien = 'AM';\r\n }\r\n // single click\r\n if (picker.params.autoOk) {\r\n picker.ok();\r\n }\r\n } else {\r\n // double click\r\n if (val === scope.currentValue){\r\n picker.ok();\r\n }\r\n picker.currentDate.minute(val);\r\n }\r\n picker.currentDate.second(0);\r\n };\r\n\r\n scope.pointAvailable = function (point) {\r\n return minuteMode ? picker.isMinuteAvailable(point.value) : picker.isHourAvailable(point.value);\r\n };\r\n\r\n var unWatcher = scope.$watch(function () {\r\n return element[0].querySelectorAll('div').length;\r\n }, function () {\r\n exec();\r\n unWatcher();\r\n });\r\n }\r\n };\r\n }]);\r\n return moduleName;\r\n}\r\n\r\n var isElectron = window && window.process && window.process.type;\r\n if (typeof define === 'function' && define.amd) {\r\n define(['moment'], ngMaterialDatePicker);\r\n } else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {\r\n module.exports = ngMaterialDatePicker(require('moment'));\r\n } else {\r\n ngMaterialDatePicker((typeof global !== 'undefined' ? global : window).moment);\r\n }\r\n})();\r\n"]} \ No newline at end of file +{"version":3,"sources":["angular-material-datetimepicker.js"],"names":["ngMaterialDatePicker","moment","moduleName","VIEW_STATES","DATE","HOUR","MINUTE","css","el","name","angular","element","window","getComputedStyle","template","module","provider","this","locale","navigator","userLanguage","language","$get","setDefaultLocale","localeString","factory","mdcDatetimePickerDefaultLocale","date","time","minutes","format","minDate","maxDate","currentDate","lang","weekStart","shortTime","cancelText","okText","amText","pmText","todayText","disableDates","disableParentScroll","autoOk","editInput","clickOutsideToClose","minuteSteps","directive","$mdDialog","$timeout","restrict","require","scope","ngChange","showTodaysDate","link","attrs","ngModel","isOn","dateOfTheDay","undefined","isString","ngModelOptions","*","debounce","$options","createChild","$formatters","push","value","m","isValid","$parsers","_d","on","e","preventDefault","blur","parent","removeClass","options","i","hasOwnProperty","isUndefined","locals","show","controller","PluginController","controllerAs","openFrom","document","body","bindToController","hasBackDrop","skipHide","multiple","then","v","isSame","$q","mdcDefaultParams","accepted_options","Object","keys","deferred","defer","copy","indexOf","resolve","reject","promise","$scope","currentView","_dialog","_attachedEvents","VIEWS","params","meridien","extend","init","$inject","prototype","timeMode","dateMode","initDates","start","currentNearestMinute","nearestMin","Math","round","minute","that","_dateParam","input","fallback","ret","isDefined","isDate","x","getTime","_isAMomentObject","map","selectDate","initDate","initHours","initMinutes","isAfterMinDate","checkHour","checkMinute","_return","_minDate","_date","hour","second","millisecond","parseInt","isBeforeMaxDate","checkTime","_maxDate","isInDisableDates","dut","calendarStart","setName","text","possible","charAt","floor","random","length","isPM","incrementMonth","amount","isNextMonthVisible","add","isPreviousMonthVisible","incrementYear","isNextYearVisible","isPreviousYearVisible","startOf","endOf","isHourAvailable","convertHours","isMinuteAvailable","today","ok","hide","cancel","selectMonthBefore","subtract","selectMonthAfter","selectYearBefore","selectYearAfter","selectAM","selectPM","h","okBtn","MONTHS_IN_ALL","Date","getFullYear","MONTHS","currentMonthIndex","low","year","month","picker","calendar","$onInit","days","toString","week","high","months","slice","topIndex","version","major","minor","getItemAtIndex","index","monthObj","generateMonthCalendar","$watch","val2","val1","nDate","startOfMonth","iNumDay","daysInMonth","iWeek","daysTmp","slices","ceil","j","toDay","substring","isInRange","isSelectedDay","isDateOfTheDay","$compile","buildCalendarContent","tbody","querySelector","cal","tbodyHtml","forEach","weekDays","weekDay","scopeRef","html","join","idx","oldIdx","minuteMode","mode","componentRoot","setTimeDegRay","deg","ray","val","divider","isTouchSupported","EVENTS","POINTER_DOWN","POINTER_UP","POINTER_MOVE","onMoveEvent","closestTarget","currentTarget","closest","clientRect","getClientRects","changedTouches","offsetWidth","pageX","left","y","pageY","top","offsetHeight","sqrt","pow","atan2","PI","off","$on","exec","clock","pickerEl","w","pl","replace","pr","clockWidth","pL","pT","mL","mT","r","points","sin","cos","style","margin-left","margin-top","display","points24","j24","h24","left24","top24","hour24","setCurrentValue","clockCenter","centerWidth","centerHeight","_hL","_mL","height","marginTop","addClass","animateHands","rotateElement","WebkitTransform","-moz-transform","-ms-transform","transform","nbH","currentValue","tmp","setTime","pointAvailable","point","unWatcher","querySelectorAll","isElectron","process","type","define","amd","exports","global"],"mappings":"CAAA,WACE,aAEF,SAASA,EAAqBC,GAC5B,IAAIC,EAAa,uBAEbC,GACFC,KAAM,EACNC,KAAM,EACNC,OAAQ,GAGNC,EAAM,SAAUC,EAAIC,GAEtB,OADAD,EAAKE,QAAQC,QAAQH,GACb,qBAAsBI,OAAUA,OAAOC,iBAAiBL,EAAG,IAAIC,GAAQD,EAAGD,IAAIE,IAGpFK,EACF,srIAoDFJ,QAAQK,OAAOb,GAAa,eACzBc,SAAS,iCAAkC,WAC1CC,KAAKC,OAASN,OAAOO,UAAUC,cAAgBR,OAAOO,UAAUE,UAAY,KAE5EJ,KAAKK,KAAO,WACV,OAAOL,MAGTA,KAAKM,iBA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GAAK,GACzCiB,EAAMmR,aAAe3E,EAAalO,EAAKwG,SAAYxG,EAAK8H,OAAS8K,GAGnElR,EAAMyK,OAAO,WACX,IAAI2G,EAAM5H,EAAO9E,uBACjB,OAAO0M,EAAMA,EAAI3S,OAAO,SAAW,IAClC,WACD0R,IACAS,MAGF5Q,EAAMqR,QAAU,SAAUvE,GACnBN,GAmBCM,IAAQ9M,EAAMmR,cAChB3H,EAAOpB,KAEToB,EAAO5K,YAAYkG,OAAOgI,KApBtBA,IAAQ9M,EAAMmR,cAAiB3H,EAAOxF,OAAOzE,QAC/CiK,EAAOpB,KAGLoB,EAAOxF,OAAOjF,UAChByK,EAAO5K,YAAYwH,KAAKoD,EAAOnC,OAAUyF,EAAM,GAAMA,IAErDtD,EAAO5K,YAAYwH,KAAK0G,GACTtD,EAAOvF,SAAlB6I,GAAO,GAAsB,KACV,MAGrBtD,EAAOxF,OAAOzE,QAChBiK,EAAOpB,MASXoB,EAAO5K,YAAYyH,OAAO,IAG5BrG,EAAMsR,eAAiB,SAAUC,GAC/B,OAAO/E,EAAahD,EAAOtB,kBAAkBqJ,EAAMtQ,OAASuI,EAAOxB,gBAAgBuJ,EAAMtQ,QAG3F,IAAIuQ,EAAYxR,EAAMyK,OAAO,WAC3B,OAAOnN,EAAQ,GAAGmU,iBAAiB,OAAOrK,QACzC,WACDqH,IACA+C,WAKH3U,EAGT,IAAI6U,EAAanU,QAAUA,OAAOoU,SAAWpU,OAAOoU,QAAQC,KACtC,mBAAXC,QAAyBA,OAAOC,IACzCD,QAAQ,UAAWlV,GACQ,oBAAXe,QAA0BA,QAAUA,OAAOqU,SAA+B,mBAAZhS,UAA4B2R,EAC1GhU,OAAOqU,QAAUpV,EAAqBoD,QAAQ,WAE9CpD,GAAwC,oBAAXqV,OAAyBA,OAASzU,QAAQX","file":"angular-material-datetimepicker.min.js","sourcesContent":["(function () {\r\n 'use strict';\r\n\r\nfunction ngMaterialDatePicker(moment) {\r\n var moduleName = \"ngMaterialDatePicker\";\r\n\r\n var VIEW_STATES = {\r\n DATE: 0,\r\n HOUR: 1,\r\n MINUTE: 2\r\n };\r\n\r\n var css = function (el, name) {\r\n el = angular.element(el);\r\n return ('getComputedStyle' in window) ? window.getComputedStyle(el[0])[name] : el.css(name);\r\n };\r\n\r\n var template = \r\n '' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentNearestMinute().format(\"dddd\")}}
' +\r\n '
{{picker.params.shortTime ? picker.currentDate.format(\"A\") : \" \"}}
' +\r\n '
' +\r\n ' ×' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"MMM\") | uppercase}}
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"DD\")}}
' +\r\n '
' +\r\n '
' +\r\n '
{{picker.currentDate.format(\"YYYY\")}}
' +\r\n '
' +\r\n '
'+\r\n '
' + //start time \r\n '
' +\r\n '
{{picker.currentNearestMinute().format(picker.params.shortTime ? \"hh:mm\" : \"HH:mm\")}} {{picker.currentDate.format(\"A\")}}
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' {{picker.params.amText}}' +\r\n '
' +\r\n '
{{picker.currentNearestMinute().format(picker.params.shortTime ? \"hh:mm\" : \"HH:mm\")}}
' +\r\n '
' +\r\n ' {{picker.params.pmText}}' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n ' ' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n ' ' +\r\n ' {{picker.params.todayText}}' +\r\n ' {{picker.params.cancelText}}' +\r\n ' {{picker.params.okText}}' +\r\n ' ' +\r\n '
';\r\n\r\n angular.module(moduleName, ['ngMaterial'])\r\n .provider('mdcDatetimePickerDefaultLocale', function () {\r\n this.locale = window.navigator.userLanguage || window.navigator.language || 'en';\r\n\r\n this.$get = function () {\r\n return this;\r\n };\r\n\r\n this.setDefaultLocale = function (localeString) {\r\n this.locale = localeString;\r\n };\r\n })\r\n .factory('mdcDefaultParams', ['mdcDatetimePickerDefaultLocale', function (mdcDatetimePickerDefaultLocale) {\r\n var default_params = {\r\n date: true,\r\n time: true,\r\n minutes: true,\r\n format: 'YYYY-MM-DD',\r\n minDate: null,\r\n maxDate: null,\r\n currentDate: null,\r\n lang: mdcDatetimePickerDefaultLocale.locale,\r\n weekStart: 0,\r\n shortTime: false,\r\n cancelText: 'Cancel',\r\n okText: 'OK',\r\n amText: 'AM',\r\n pmText: 'PM',\r\n todayText: 'Today',\r\n disableDates: [],\r\n disableParentScroll: false,\r\n autoOk: false,\r\n editInput: false,\r\n clickOutsideToClose: false,\r\n minuteSteps: 5\r\n };\r\n return default_params;\r\n }])\r\n .directive('mdcDatetimePicker', ['$mdDialog', '$timeout',\r\n function ($mdDialog, $timeout) {\r\n\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n scope: {\r\n currentDate: '=ngModel',\r\n ngChange: '&',\r\n time: '=',\r\n date: '=',\r\n minutes: '=',\r\n minDate: '=',\r\n maxDate: '=',\r\n disableDates: '=',\r\n shortTime: '=',\r\n weekStart: '=',\r\n format: '@',\r\n cancelText: '@',\r\n okText: '@',\r\n lang: '@',\r\n amText: '@',\r\n pmText: '@',\r\n showTodaysDate: '@',\r\n todayText: '@',\r\n disableParentScroll: '=',\r\n autoOk: '=',\r\n editInput: '=',\r\n clickOutsideToClose: '=',\r\n minuteSteps: '='\r\n },\r\n link: function (scope, element, attrs, ngModel) {\r\n var isOn = false;\r\n if (!scope.format) {\r\n if (scope.date && scope.time) {\r\n scope.format = 'YYYY-MM-DD HH:mm';\r\n } else if (scope.date) {\r\n scope.format = 'YYYY-MM-DD';\r\n } else {\r\n scope.format = 'HH:mm';\r\n }\r\n }\r\n\r\n var dateOfTheDay = null;\r\n if (scope.showTodaysDate !== undefined && scope.showTodaysDate !== \"false\") {\r\n dateOfTheDay = moment();\r\n }\r\n\r\n if (angular.isString(scope.currentDate) && scope.currentDate !== '') {\r\n scope.currentDate = moment(scope.currentDate, scope.format);\r\n }\r\n\r\n if (ngModel) {\r\n var ngModelOptions = {'*': '$inherit', debounce: 500};\r\n ngModel.$options = ngModel.$options ? ngModel.$options.createChild(ngModelOptions) : ngModelOptions;\r\n \r\n ngModel.$formatters.push(function (value) {\r\n if (typeof value === 'undefined') return;\r\n var m = moment(value);\r\n return m.isValid() ? m.format(scope.format) : '';\r\n });\r\n \r\n ngModel.$parsers.push(function (value) {\r\n if (typeof value === 'undefined') return;\r\n var m = moment(value, scope.format);\r\n if (m.isValid()) return m._d;\r\n return;\r\n });\r\n \r\n }\r\n\r\n //@TODO custom event to trigger input\r\n if (!scope.editInput) {\r\n element.on('focus', function (e) {\r\n e.preventDefault();\r\n element.blur();\r\n element.parent().removeClass('md-input-focused');\r\n if (isOn) {\r\n return;\r\n }\r\n isOn = true;\r\n var options = {};\r\n for (var i in attrs) {\r\n if (scope.hasOwnProperty(i) && !angular.isUndefined(scope[i])) {\r\n options[i] = scope[i];\r\n }\r\n }\r\n options.currentDate = scope.currentDate;\r\n options.showTodaysDate = dateOfTheDay;\r\n\r\n var locals = {options: options};\r\n $mdDialog.show({\r\n template: template,\r\n controller: PluginController,\r\n controllerAs: 'picker',\r\n locals: locals,\r\n openFrom: element,\r\n parent: angular.element(document.body),\r\n bindToController: true,\r\n clickOutsideToClose: options.clickOutsideToClose || false,\r\n disableParentScroll: options.disableParentScroll || false,\r\n hasBackDrop: false,\r\n skipHide: true,\r\n multiple: true\r\n })\r\n .then(function (v) {\r\n scope.currentDate = v ? v._d : v;\r\n isOn = false;\r\n\r\n if (!moment(scope.currentDate).isSame(options.currentDate)) {\r\n $timeout(scope.ngChange, 0);\r\n }\r\n\r\n element.parent().removeClass('md-input-focused');\r\n\r\n }, function () {\r\n isOn = false;\r\n element.parent().removeClass('md-input-focused');\r\n })\r\n ;\r\n });\r\n }\r\n }\r\n };\r\n }])\r\n /** Returns a service that opens a dialog when the attribute shown is called\r\n The dialog serves to select a date/time/etc. depending on the options given to the function show\r\n\r\n @param options extends mdcDefaultParams\r\n {\r\n date: {boolean} =true,\r\n time: {boolean} =true,\r\n minutes: {boolean} =true,\r\n format: {string} ='YYYY-MM-DD',\r\n minDate: {strign} =null,\r\n maxDate: {string} =null,\r\n currentDate: {string} =null,\r\n lang: {string} =mdcDatetimePickerDefaultLocale,\r\n weekStart: {int} =0,\r\n shortTime: {boolean} =false,\r\n cancelText: {string} ='Cancel',\r\n showTodaysDate: {string} ='',\r\n todayText: {string} ='Today',\r\n okText: {string} ='OK',\r\n amText: {string} ='AM',\r\n pmText: {string} ='PM',\r\n disableDates: {date[]} =[],\r\n disableParentScroll: {boolean} =false,\r\n autoOk: {boolean} =false,\r\n editInput: {boolean} =false,\r\n clickOutsideToClose: {boolean} =false,\r\n minuteSteps: {int} =5\r\n }\r\n @return promise\r\n */\r\n .factory('mdcDateTimeDialog', [\"$mdDialog\", \"$q\", \"mdcDefaultParams\", function ($mdDialog, $q, mdcDefaultParams) {\r\n var accepted_options = Object.keys(mdcDefaultParams);\r\n var service = {\r\n show: function (options) {\r\n var deferred = $q.defer();\r\n var params = angular.copy(mdcDefaultParams);\r\n for (var i in options) {\r\n if (accepted_options.indexOf[i] != -1 && options.hasOwnProperty(i)) {\r\n params = options[i];\r\n }\r\n }\r\n\r\n var dateOfTheDay = null;\r\n if (options.showTodaysDate !== undefined && options.showTodaysDate !== \"false\") {\r\n dateOfTheDay = moment();\r\n }\r\n options.showTodaysDate = dateOfTheDay;\r\n\r\n var locals = {options: options};\r\n $mdDialog.show({\r\n template: template,\r\n controller: PluginController,\r\n controllerAs: 'picker',\r\n locals: locals,\r\n parent: angular.element(document.body),\r\n bindToController: true,\r\n clickOutsideToClose: options.clickOutsideToClose || false,\r\n disableParentScroll: options.disableParentScroll || false,\r\n skipHide: true,\r\n multiple: true\r\n })\r\n .then(function (v) {\r\n var currentDate = v ? v._d : v;\r\n deferred.resolve(v ? v._d : v);\r\n }, function () {\r\n deferred.reject();\r\n });\r\n return deferred.promise;\r\n }\r\n };\r\n\r\n return service;\r\n }])\r\n ;\r\n\r\n var PluginController = function ($scope, $mdDialog, mdcDefaultParams) {\r\n this.currentView = VIEW_STATES.DATE;\r\n this._dialog = $mdDialog;\r\n\r\n this._attachedEvents = [];\r\n this.VIEWS = VIEW_STATES;\r\n this.params = angular.copy(mdcDefaultParams);\r\n this.meridien = 'AM';\r\n this.params = angular.extend(this.params, this.options);\r\n\r\n this.init();\r\n };\r\n\r\n PluginController.$inject = ['$scope', '$mdDialog', 'mdcDefaultParams'];\r\n PluginController.prototype = {\r\n init: function () {\r\n this.timeMode = this.params.time && !this.params.date;\r\n this.dateMode = this.params.date;\r\n this.initDates();\r\n this.start();\r\n },\r\n currentNearestMinute: function () {\r\n var nearestMin = this.params.minuteSteps;\r\n if (nearestMin < 1 || nearestMin > 59) nearestMin = 1;\r\n\r\n var date = this.currentDate || moment();\r\n var minutes = (nearestMin * Math.round(date.minute() / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n return moment(date).minutes(minutes);\r\n },\r\n initDates: function () {\r\n var that = this;\r\n var _dateParam = function (input, fallback) {\r\n var ret = null;\r\n if (angular.isDefined(input) && input !== null && input !== '') {\r\n if (angular.isString(input)) {\r\n if (typeof(that.params.format) !== 'undefined' && that.params.format !== null) {\r\n ret = moment(input, that.params.format).locale(that.params.lang);\r\n }\r\n else {\r\n ret = moment(input).locale(that.params.lang);\r\n }\r\n } else if (typeof input === 'number') {\r\n ret = moment(input).locale(that.params.lang);\r\n } else {\r\n if (angular.isDate(input)) {\r\n var x = input.getTime();\r\n ret = moment(x, \"x\").locale(that.params.lang);\r\n } else if (input._isAMomentObject) {\r\n ret = input;\r\n }\r\n }\r\n }\r\n else {\r\n ret = fallback;\r\n }\r\n return ret;\r\n };\r\n\r\n this.currentDate = _dateParam(this.params.currentDate, moment());\r\n this.minDate = _dateParam(this.params.minDate);\r\n this.maxDate = _dateParam(this.params.maxDate);\r\n this.disableDates = this.params.disableDates.map(function (x) {\r\n return moment(x).format('MMMM Do YYYY');\r\n });\r\n this.selectDate(this.currentDate);\r\n },\r\n initDate: function () {\r\n this.currentView = VIEW_STATES.DATE;\r\n },\r\n initHours: function () {\r\n this.currentView = VIEW_STATES.HOUR;\r\n },\r\n initMinutes: function () {\r\n this.currentView = VIEW_STATES.MINUTE;\r\n },\r\n isAfterMinDate: function (date, checkHour, checkMinute) {\r\n var _return = true;\r\n\r\n if (typeof(this.minDate) !== 'undefined' && this.minDate !== null) {\r\n var _minDate = moment(this.minDate);\r\n var _date = moment(date);\r\n\r\n if (!checkHour && !checkMinute) {\r\n _minDate.hour(0);\r\n _minDate.minute(0);\r\n\r\n _date.hour(0);\r\n _date.minute(0);\r\n }\r\n\r\n _minDate.second(0);\r\n _date.second(0);\r\n _minDate.millisecond(0);\r\n _date.millisecond(0);\r\n\r\n if (!checkMinute) {\r\n _date.minute(0);\r\n _minDate.minute(0);\r\n\r\n _return = (parseInt(_date.format(\"X\")) >= parseInt(_minDate.format(\"X\")));\r\n }\r\n else {\r\n _return = (parseInt(_date.format(\"X\")) >= parseInt(_minDate.format(\"X\")));\r\n }\r\n }\r\n\r\n return _return;\r\n },\r\n isBeforeMaxDate: function (date, checkTime, checkMinute) {\r\n var _return = true;\r\n\r\n if (typeof(this.maxDate) !== 'undefined' && this.maxDate !== null) {\r\n var _maxDate = moment(this.maxDate);\r\n var _date = moment(date);\r\n\r\n if (!checkTime && !checkMinute) {\r\n _maxDate.hour(0);\r\n _maxDate.minute(0);\r\n\r\n _date.hour(0);\r\n _date.minute(0);\r\n }\r\n\r\n _maxDate.second(0);\r\n _date.second(0);\r\n _maxDate.millisecond(0);\r\n _date.millisecond(0);\r\n\r\n if (!checkMinute) {\r\n _date.minute(0);\r\n _maxDate.minute(0);\r\n\r\n _return = (parseInt(_date.format(\"X\")) <= parseInt(_maxDate.format(\"X\")));\r\n }\r\n else {\r\n _return = (parseInt(_date.format(\"X\")) <= parseInt(_maxDate.format(\"X\")));\r\n }\r\n }\r\n\r\n return _return;\r\n },\r\n isInDisableDates: function (date) {\r\n var dut = date.format('MMMM Do YYYY');\r\n if (this.disableDates.indexOf(dut) > -1) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n selectDate: function (date) {\r\n if (date) {\r\n this.currentDate = moment(date);\r\n if (!this.isAfterMinDate(this.currentDate)) {\r\n this.currentDate = moment(this.minDate);\r\n }\r\n\r\n if (!this.isBeforeMaxDate(this.currentDate)) {\r\n this.currentDate = moment(this.maxDate);\r\n }\r\n this.currentDate.locale(this.params.lang);\r\n this.calendarStart = moment(this.currentDate);\r\n this.meridien = this.currentDate.hour() >= 12 ? 'PM' : 'AM';\r\n }\r\n },\r\n setName: function () {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < 5; i++) {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n\r\n return text;\r\n },\r\n isPM: function () {\r\n return this.meridien === 'PM';\r\n },\r\n incrementMonth: function (amount) {\r\n if (amount === 1 && this.isNextMonthVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'month'));\r\n }\r\n\r\n if (amount === -1 && this.isPreviousMonthVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'month'));\r\n }\r\n },\r\n incrementYear: function (amount) {\r\n if (amount === 1 && this.isNextYearVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'year'));\r\n }\r\n\r\n if (amount === -1 && this.isPreviousYearVisible()) {\r\n this.selectDate(this.currentDate.add(amount, 'year'));\r\n }\r\n },\r\n isPreviousMonthVisible: function () {\r\n return this.calendarStart && this.isAfterMinDate(moment(this.calendarStart).startOf('month'), false, false);\r\n },\r\n isNextMonthVisible: function () {\r\n return this.calendarStart && this.isBeforeMaxDate(moment(this.calendarStart).endOf('month'), false, false);\r\n },\r\n isPreviousYearVisible: function () {\r\n return this.calendarStart && this.isAfterMinDate(moment(this.calendarStart).startOf('year'), false, false);\r\n },\r\n isNextYearVisible: function () {\r\n return this.calendarStart && this.isBeforeMaxDate(moment(this.calendarStart).endOf('year'), false, false);\r\n },\r\n isHourAvailable: function (hour) {\r\n var _date = moment(this.currentDate);\r\n if (this.params.shortTime) {\r\n _date.hour(this.convertHours(hour)).minute(0).second(0);\r\n } else {\r\n _date.hour(hour).minute(0).second(0);\r\n }\r\n return this.isAfterMinDate(_date, true, false) && this.isBeforeMaxDate(_date, true, false);\r\n },\r\n isMinuteAvailable: function (minute) {\r\n var _date = moment(this.currentDate);\r\n _date.minute(minute).second(0);\r\n return this.isAfterMinDate(_date, true, true) && this.isBeforeMaxDate(_date, true, true);\r\n },\r\n start: function () {\r\n this.currentView = VIEW_STATES.DATE;\r\n if (this.params.date) {\r\n this.initDate();\r\n } else {\r\n if (this.params.time) {\r\n this.initHours();\r\n }\r\n }\r\n },\r\n today: function () {\r\n var nearestMin = this.params.minuteSteps;\r\n var date = moment();\r\n var minutes = (nearestMin * Math.round(date.minute() / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n this.selectDate(moment(date).minutes(minutes));\r\n },\r\n ok: function () {\r\n switch (this.currentView) {\r\n case VIEW_STATES.DATE:\r\n if (this.params.time === true) {\r\n this.initHours();\r\n } else {\r\n this.hide(true);\r\n }\r\n break;\r\n case VIEW_STATES.HOUR:\r\n if (this.params.minutes === true) {\r\n this.initMinutes();\r\n } else {\r\n this.hide(true);\r\n }\r\n break;\r\n case VIEW_STATES.MINUTE:\r\n this.hide(true);\r\n break;\r\n }\r\n },\r\n cancel: function () {\r\n if (this.params.time) {\r\n switch (this.currentView) {\r\n case VIEW_STATES.DATE:\r\n this.hide();\r\n break;\r\n case VIEW_STATES.HOUR:\r\n if (this.params.date) {\r\n this.initDate();\r\n }\r\n else {\r\n this.hide();\r\n }\r\n break;\r\n case VIEW_STATES.MINUTE:\r\n this.initHours();\r\n break;\r\n }\r\n }\r\n else {\r\n this.hide();\r\n }\r\n },\r\n selectMonthBefore: function () {\r\n this.calendarStart.subtract(1, 'months');\r\n },\r\n selectMonthAfter: function () {\r\n this.calendarStart.add(1, 'months');\r\n },\r\n selectYearBefore: function () {\r\n this.calendarStart.subtract(1, 'years');\r\n },\r\n selectYearAfter: function () {\r\n this.calendarStart.add(1, 'years');\r\n },\r\n selectAM: function () {\r\n if (this.isHourAvailable(0) || this.isHourAvailable(12)) {\r\n if (this.currentDate.hour() >= 12) {\r\n this.selectDate(this.currentDate.subtract(12, 'hours'));\r\n }\r\n if (!this.isHourAvailable(this.currentDate.hour())) {\r\n this.selectDate(this.currentDate.hour(this.minDate.hour()));\r\n }\r\n if (!this.isMinuteAvailable(this.currentDate.minute())) {\r\n this.selectDate(this.currentDate.minute(this.minDate.minute()));\r\n }\r\n }\r\n },\r\n selectPM: function () {\r\n if (this.isHourAvailable(13) || this.isHourAvailable(24)) {\r\n if (this.currentDate.hour() < 12) {\r\n this.selectDate(this.currentDate.add(12, 'hours'));\r\n }\r\n if (!this.isHourAvailable(this.currentDate.hour())) {\r\n this.selectDate(this.currentDate.hour(this.maxDate.hour()));\r\n }\r\n if (!this.isMinuteAvailable(this.currentDate.minute())) {\r\n this.selectDate(this.currentDate.minute(this.maxDate.minute()));\r\n }\r\n }\r\n },\r\n convertHours: function (h) {\r\n var _return = h;\r\n if ((h < 12) && this.isPM())\r\n _return += 12;\r\n\r\n return _return;\r\n },\r\n hide: function (okBtn) {\r\n if (okBtn) {\r\n this._dialog.hide(this.currentDate);\r\n } else {\r\n this._dialog.cancel();\r\n }\r\n }\r\n };\r\n\r\n\r\n angular.module(moduleName)\r\n .directive('mdcDatetimePickerCalendar', [\r\n function () {\r\n\r\n var YEAR_MIN = 1920,\r\n YEAR_MAX = new Date().getFullYear() + 30,\r\n MONTHS_IN_ALL = (YEAR_MAX - YEAR_MIN + 1) * 12,\r\n ITEM_HEIGHT = 240,\r\n MONTHS = [];\r\n for (var i = 0; i < MONTHS_IN_ALL; i++) {\r\n MONTHS.push(i);\r\n }\r\n\r\n var currentMonthIndex = function (date, low) {\r\n low = low ? low : 0;\r\n var year = date.year();\r\n var month = date.month();\r\n return (((year - YEAR_MIN) * 12) + month - 1 ) - low;\r\n };\r\n\r\n return {\r\n restrict: 'E',\r\n scope: {\r\n picker: '=',\r\n date: '='\r\n },\r\n bindToController: true,\r\n controllerAs: 'cal',\r\n controller: ['$scope', function ($scope) {\r\n var calendar = this, picker;\r\n\r\n this.$onInit = function () {\r\n picker = this.picker;\r\n\r\n var days = [];\r\n for (var i = picker.params.weekStart; days.length < 7; i++) {\r\n if (i > 6) {\r\n i = 0;\r\n }\r\n days.push(i.toString());\r\n }\r\n calendar.week = days;\r\n\r\n if (!picker.maxDate && !picker.minDate) {\r\n calendar.months = MONTHS;\r\n } else {\r\n var low = picker.minDate ? currentMonthIndex(picker.minDate) : 0;\r\n var high = picker.maxDate ? (currentMonthIndex(picker.maxDate) + 1) : MONTHS_IN_ALL;\r\n calendar.months = MONTHS.slice(low, high);\r\n }\r\n\r\n calendar.topIndex = currentMonthIndex(picker.currentDate) - calendar.months[0];\r\n };\r\n\r\n if (angular.version.major === 1 && angular.version.minor < 5) {\r\n this.$onInit();\r\n }\r\n \r\n calendar.getItemAtIndex = function (index) {\r\n var month = ((index + 1) % 12) || 12;\r\n var year = YEAR_MIN + Math.floor(index / 12);\r\n var monthObj = moment(picker.currentDate).year(year).month(month);\r\n return generateMonthCalendar(monthObj);\r\n };\r\n\r\n $scope.$watch(function () {\r\n return picker.currentDate ? picker.currentDate.format('YYYY-MM') : '';\r\n }, function (val2, val1) {\r\n if (val2 != val1) {\r\n var nDate = moment(val2, 'YYYY-MM');\r\n var low = picker.minDate ? currentMonthIndex(picker.minDate) : 0;\r\n var index = currentMonthIndex(nDate, low);\r\n if (calendar.topIndex != index) {\r\n calendar.topIndex = index;\r\n }\r\n }\r\n });\r\n\r\n var generateMonthCalendar = function (date) {\r\n var month = {};\r\n if (date !== null) {\r\n month.name = date.format('MMMM YYYY');\r\n var startOfMonth = moment(date).locale(picker.params.lang).startOf('month')\r\n .hour(date.hour())\r\n .minute(date.minute());\r\n var iNumDay = startOfMonth.format('d');\r\n month.days = [];\r\n for (var i = startOfMonth.date(); i <= startOfMonth.daysInMonth(); i++) {\r\n if (i === startOfMonth.date()) {\r\n var iWeek = calendar.week.indexOf(iNumDay.toString());\r\n if (iWeek > 0) {\r\n for (var x = 0; x < iWeek; x++) {\r\n month.days.push(0);\r\n }\r\n }\r\n }\r\n month.days.push(moment(startOfMonth).locale(picker.params.lang).date(i));\r\n }\r\n\r\n var daysInAWeek = 7, daysTmp = [], slices = Math.ceil(month.days.length / daysInAWeek);\r\n for (var j = 0; j < slices; j++) {\r\n daysTmp.push(month.days.slice(j * daysInAWeek, (j + 1) * daysInAWeek));\r\n }\r\n month.days = daysTmp;\r\n return month;\r\n }\r\n\r\n };\r\n\r\n calendar.toDay = function (i) {\r\n return moment(parseInt(i), \"d\")\r\n .locale(picker.params.lang)\r\n .format(\"dd\")\r\n .substring(0, 1);\r\n };\r\n\r\n calendar.isInRange = function (date) {\r\n return picker.isAfterMinDate(moment(date), false, false) &&\r\n picker.isBeforeMaxDate(moment(date), false, false) &&\r\n picker.isInDisableDates(moment(date));\r\n };\r\n\r\n calendar.selectDate = function (date) {\r\n if (date) {\r\n if (calendar.isSelectedDay(date)) {\r\n return picker.ok();\r\n }\r\n picker.selectDate(moment(date).hour(calendar.date.hour()).minute(calendar.date.minute()));\r\n if (picker.params.autoOk) {\r\n picker.ok();\r\n }\r\n }\r\n };\r\n\r\n calendar.isSelectedDay = function (m) {\r\n return m && calendar.date.date() === m.date() && calendar.date.month() === m.month() && calendar.date.year() === m.year();\r\n };\r\n\r\n calendar.isDateOfTheDay = function (m) {\r\n var today = calendar.picker.options.showTodaysDate;\r\n if (!today) {\r\n return false;\r\n }\r\n\r\n return m && today.date() === m.date() && today.month() === m.month() && today.year() === m.year();\r\n };\r\n }],\r\n template: \r\n '' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
'\r\n };\r\n }])\r\n .directive('mdcDatetimePickerCalendarMonth', ['$compile',\r\n function ($compile) {\r\n var buildCalendarContent = function (element, scope) {\r\n var tbody = angular.element(element[0].querySelector('tbody'));\r\n var calendar = scope.cal, month = scope.month;\r\n\r\n var tbodyHtml = [];\r\n\r\n month.days.forEach(function (weekDays, i) {\r\n tbodyHtml.push('');\r\n weekDays.forEach(function (weekDay, j) {\r\n tbodyHtml.push('');\r\n if (weekDay) {\r\n if (calendar.isInRange(weekDay)) {\r\n //build a\r\n var scopeRef = 'month[\\'days\\'][' + i + '][' + j + ']';\r\n\r\n tbodyHtml.push('');\r\n tbodyHtml.push(weekDay.format('D'));\r\n tbodyHtml.push('');\r\n } else {\r\n tbodyHtml.push('');\r\n tbodyHtml.push(weekDay.format('D'));\r\n tbodyHtml.push('');\r\n }\r\n }\r\n tbodyHtml.push('');\r\n });\r\n tbodyHtml.push('');\r\n });\r\n\r\n tbody.html(tbodyHtml.join(''));\r\n $compile(tbody)(scope);\r\n };\r\n\r\n return {\r\n scope: {\r\n idx: '='\r\n },\r\n require: '^mdcDatetimePickerCalendar',\r\n restrict: 'AE',\r\n template: \r\n '
{{month.name}}
' +\r\n '' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n ' ' +\r\n '
{{cal.toDay(day)}}
',\r\n link: function (scope, element, attrs, calendar) {\r\n scope.cal = calendar;\r\n scope.month = calendar.getItemAtIndex(parseInt(scope.idx));\r\n buildCalendarContent(element, scope);\r\n scope.$watch(function () {\r\n return scope.idx;\r\n }, function (idx, oldIdx) {\r\n if (idx != oldIdx) {\r\n scope.month = calendar.getItemAtIndex(parseInt(scope.idx));\r\n buildCalendarContent(element, scope);\r\n }\r\n });\r\n }\r\n };\r\n }\r\n ])\r\n ;\r\n\r\n angular.module(moduleName)\r\n .directive('mdcDtpNoclick', function () {\r\n return {\r\n link: function (scope, el) {\r\n el.on('click', function (e) {\r\n e.preventDefault();\r\n });\r\n }\r\n };\r\n });\r\n angular.module(moduleName)\r\n .directive('mdcDatetimePickerClock', ['$timeout',\r\n function ($timeout) {\r\n\r\n var template = \r\n '
 ' +\r\n '
' +\r\n ' {{point.display}}' +\r\n ' {{point.display}}' +\r\n '
' +\r\n '
' +\r\n ' {{point24.display}}' +\r\n ' {{point24.display}}' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
' +\r\n '
';\r\n\r\n return {\r\n restrict: 'E',\r\n template: template,\r\n link: function (scope, element, attrs) {\r\n var minuteMode = attrs.mode === 'minutes';\r\n var picker = scope.picker;\r\n //banking on the fact that there will only be one at a time\r\n var componentRoot = document.querySelector('md-dialog.dtp');\r\n\r\n var setTimeDegRay = function(deg, ray) {\r\n var val = 0;\r\n deg = deg >= 360 ? 0 : deg;\r\n if (deg !== 0) {\r\n var divider = minuteMode ? 60 : 12;\r\n val = Math.round(divider / 360 * deg);\r\n }\r\n\r\n if (minuteMode) {\r\n var nearestMin = picker.params.minuteSteps;\r\n if (nearestMin < 1 || nearestMin > 59) nearestMin = 1;\r\n\r\n var minutes = (nearestMin * Math.round(val / nearestMin));\r\n if (minutes >= 60) {\r\n minutes = 60 - nearestMin; //always push down\r\n }\r\n picker.currentDate.minute(minutes);\r\n } else {\r\n if (val === 12) val = 0;\r\n if (!picker.params.shortTime) picker.meridien = ray > 84 ? 'AM' : 'PM';\r\n picker.currentDate.hour(picker.isPM() ? val + 12 : val);\r\n }\r\n picker.currentDate.second(0);\r\n };\r\n\r\n var isTouchSupported = ('ontouchstart' in window) ? true : false,\r\n EVENTS = {\r\n POINTER_DOWN : isTouchSupported ? 'touchstart' : 'mousedown',\r\n POINTER_UP : isTouchSupported ? 'touchend' : 'mouseup',\r\n POINTER_MOVE : isTouchSupported ? 'touchmove' : 'mousemove'\r\n };\r\n\r\n var onMoveEvent = function(e) {\r\n e.preventDefault();\r\n\r\n var closestTarget = e.currentTarget.closest('div'),\r\n clientRect = closestTarget.getClientRects()[0];\r\n\r\n if (isTouchSupported) e = e.changedTouches[0];\r\n \r\n var x = ((closestTarget.offsetWidth / 2) - (e.pageX - clientRect.left)),\r\n y = ((e.pageY - clientRect.top) - (closestTarget.offsetHeight / 2));\r\n \r\n var ray = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));\r\n var deg = Math.round((Math.atan2(x, y) * (180 / Math.PI)));\r\n\r\n $timeout(function() {\r\n setTimeDegRay(deg+180, ray);\r\n });\r\n };\r\n\r\n element.on(EVENTS.POINTER_DOWN, function() {\r\n element.on(EVENTS.POINTER_MOVE, onMoveEvent);\r\n });\r\n\r\n element.on(EVENTS.POINTER_UP, function() {\r\n element.off(EVENTS.POINTER_MOVE);\r\n });\r\n\r\n scope.$on(\"$destroy\", function() {\r\n element.off(EVENTS.POINTER_MOVE, onMoveEvent); \r\n });\r\n\r\n var exec = function () {\r\n var clock = angular.element(element[0].querySelector('.dtp-picker-clock')),\r\n pickerEl = angular.element(componentRoot.querySelector('.dtp-picker'));\r\n\r\n var w = componentRoot.querySelector('.dtp-content').offsetWidth;\r\n var pl = parseInt(css(pickerEl, 'paddingLeft').replace('px', '')) || 0;\r\n var pr = parseInt(css(pickerEl, 'paddingRight').replace('px', '')) || 0;\r\n var ml = parseInt(css(clock, 'marginLeft').replace('px', '')) || 0;\r\n var mr = parseInt(css(clock, 'marginRight').replace('px', '')) || 0;\r\n //set width\r\n var clockWidth = (w - (ml + mr + pl + pr));\r\n clock.css('width', (clockWidth) + 'px');\r\n\r\n var pL = parseInt(css(pickerEl, 'paddingLeft').replace('px', '')) || 0;\r\n var pT = parseInt(css(pickerEl, 'paddingTop').replace('px', '')) || 0;\r\n var mL = parseInt(css(clock, 'marginLeft').replace('px', '')) || 0;\r\n var mT = parseInt(css(clock, 'marginTop').replace('px', '')) || 0;\r\n\r\n var r = (clockWidth / 2);\r\n var j = r / 1.2; // radius for low number\r\n \r\n var points = [];\r\n\r\n for (var h = 0; h < 12; ++h) {\r\n var x = j * Math.sin(Math.PI * 2 * (h / 12));\r\n var y = j * Math.cos(Math.PI * 2 * (h / 12));\r\n var left = (r + x + pL / 2) - (pL + mL);\r\n var top = (r - y - mT / 2) - (pT + mT);\r\n\r\n var hour = {\r\n left: left,\r\n top: top,\r\n value: (minuteMode ? (h * 5) : h), //5 for minute 60/12\r\n style: {'margin-left': left + 'px', 'margin-top': top + 'px'}\r\n };\r\n\r\n if (minuteMode) {\r\n hour.display = hour.value < 10 ? ('0' + hour.value) : hour.value;\r\n } else {\r\n\r\n if (picker.params.shortTime) {\r\n hour.display = (h === 0) ? 12 : h;\r\n } else {\r\n hour.display = h;\r\n }\r\n }\r\n\r\n points.push(hour);\r\n }\r\n scope.points = points;\r\n\r\n if (!picker.params.shortTime && !minuteMode) {\r\n var points24 = [];\r\n\r\n var j24 = r / 1.8; // radius for high number\r\n for (var h24 = 12; h24 < 24; ++h24) {\r\n var x24 = j24 * Math.sin(Math.PI * 2 * (h24 / 12));\r\n var y24 = j24 * Math.cos(Math.PI * 2 * (h24 / 12));\r\n var left24 = (r + x24 + pL / 2) - (pL + mL);\r\n var top24 = (r - y24 - mT / 2) - (pT + mT);\r\n\r\n var hour24 = {\r\n left: left24,\r\n top: top24,\r\n value: h24,\r\n style: {'margin-left': left24 + 'px', 'margin-top': top24 + 'px'}\r\n };\r\n\r\n hour24.display = h24;\r\n\r\n points24.push(hour24);\r\n }\r\n scope.points24 = points24;\r\n }\r\n\r\n scope.mode = attrs.mode;\r\n setCurrentValue();\r\n clock.css('height', clockWidth + 'px');\r\n\r\n var clockCenter = element[0].querySelector('.dtp-clock-center');\r\n var centerWidth = (clockCenter.offsetWidth / 2) || 7.5,\r\n centerHeight = (clockCenter.offsetHeight / 2) || 7.5;\r\n var _hL = r / (picker.params.shortTime ? 1.8 : 2.3);\r\n var _mL = r / 1.5;\r\n\r\n angular.element(element[0].querySelector('.dtp-hour-hand')).css({\r\n left: r + (mL * 1.5) + 'px',\r\n height: _hL + 'px',\r\n marginTop: (r - _hL - pL) + 'px'\r\n }).addClass(!minuteMode ? 'on' : '');\r\n\r\n angular.element(element[0].querySelector('.dtp-minute-hand')).css\r\n ({\r\n left: r + (mL * 1.5) + 'px',\r\n height: _mL + 'px',\r\n marginTop: (r - _mL - pL) + 'px'\r\n }).addClass(minuteMode ? 'on' : '');\r\n\r\n angular.element(clockCenter).css({\r\n left: (r + pL + mL - centerWidth) + 'px',\r\n marginTop: (r - (mL / 2)) - centerHeight + 'px'\r\n });\r\n animateHands();\r\n };\r\n\r\n var animateHands = function () {\r\n var _date = picker.currentNearestMinute();\r\n var h = _date.hour();\r\n var m = _date.minute();\r\n\r\n rotateElement(angular.element(element[0].querySelector('.dtp-hour-hand')), 30 * h);\r\n rotateElement(angular.element(element[0].querySelector('.dtp-minute-hand')), 6 * m);\r\n };\r\n\r\n var rotateElement = function (el, deg) {\r\n angular.element(el).css({\r\n WebkitTransform: 'rotate(' + deg + 'deg)',\r\n '-moz-transform': 'rotate(' + deg + 'deg)',\r\n '-ms-transform': 'rotate(' + deg + 'deg)',\r\n 'transform': 'rotate(' + deg + 'deg)'\r\n });\r\n };\r\n\r\n\r\n var setCurrentValue = function () {\r\n var date = picker.currentNearestMinute();\r\n var nbH = picker.params.shortTime ? 12 : 24;\r\n scope.currentValue = minuteMode ? date.minute() : (date.hour() % nbH);\r\n };\r\n\r\n scope.$watch(function () {\r\n var tmp = picker.currentNearestMinute();\r\n return tmp ? tmp.format('HH:mm') : '';\r\n }, function () {\r\n setCurrentValue();\r\n animateHands();\r\n });\r\n\r\n scope.setTime = function (val) {\r\n if (!minuteMode) {\r\n // double click\r\n if (val === scope.currentValue && !picker.params.autoOk){\r\n picker.ok();\r\n }\r\n\r\n if (picker.params.shortTime) {\r\n picker.currentDate.hour(picker.isPM() ? (val + 12) : val);\r\n } else {\r\n picker.currentDate.hour(val);\r\n if (val >= 12) picker.meridien = 'PM';\r\n else picker.meridien = 'AM';\r\n }\r\n // single click\r\n if (picker.params.autoOk) {\r\n picker.ok();\r\n }\r\n } else {\r\n // double click\r\n if (val === scope.currentValue){\r\n picker.ok();\r\n }\r\n picker.currentDate.minute(val);\r\n }\r\n picker.currentDate.second(0);\r\n };\r\n\r\n scope.pointAvailable = function (point) {\r\n return minuteMode ? picker.isMinuteAvailable(point.value) : picker.isHourAvailable(point.value);\r\n };\r\n\r\n var unWatcher = scope.$watch(function () {\r\n return element[0].querySelectorAll('div').length;\r\n }, function () {\r\n exec();\r\n unWatcher();\r\n });\r\n }\r\n };\r\n }]);\r\n return moduleName;\r\n}\r\n\r\n var isElectron = window && window.process && window.process.type;\r\n if (typeof define === 'function' && define.amd) {\r\n define(['moment'], ngMaterialDatePicker);\r\n } else if (typeof module !== 'undefined' && module && module.exports && (typeof require === 'function') && !isElectron) {\r\n module.exports = ngMaterialDatePicker(require('moment'));\r\n } else {\r\n ngMaterialDatePicker((typeof global !== 'undefined' ? global : window).moment);\r\n }\r\n})();\r\n"]} \ No newline at end of file diff --git a/dist/material-datetimepicker.min.css b/dist/material-datetimepicker.min.css index e47f075..4ae7c1d 100644 --- a/dist/material-datetimepicker.min.css +++ b/dist/material-datetimepicker.min.css @@ -1 +1 @@ -md-dialog.dtp{font-size:14px;line-height:1.42857143;color:#333;background-color:#fff;max-height:none;min-width:300px}.noselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dtp :focus{outline:0!important}.dtp table{border-spacing:0;border-collapse:collapse;width:100%}.dtp .table>tbody>tr>td,.dtp .table>tbody>tr>th,.dtp .table>tfoot>tr>td,.dtp .table>tfoot>tr>th,.dtp .table>thead>tr>td,.dtp .table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.dtp,.dtp *{box-sizing:border-box!important}.dtp>.dtp-content{max-width:300px;max-height:500px}.dtp>.dtp-content>.dtp-date-view>header.dtp-header{background:#689f38;color:#fff;text-align:center}.dtp div.dtp-date,.dtp div.dtp-time{background:#8bc34a;text-align:center;color:#fff;padding:10px}.dtp div.dtp-date>div{padding:0;margin:0}.dtp div.dtp-actual-month{font-size:1.5em}.dtp div.dtp-actual-num{font-size:2em;line-height:.9}.dtp div.dtp-actual-maxtime{font-size:2em;line-height:.9}.dtp div.dtp-actual-year{font-size:1.6em;color:#dcedc8}.dtp div.dtp-month-btn{font-size:1.4em;line-height:30px;cursor:pointer}.dtp div.dtp-month-btn-prev{text-align:right}.dtp div.dtp-month-btn-next{text-align:left}.dtp div.dtp-year-btn{font-size:1.4em;line-height:30px;cursor:pointer;color:#dcedc8}.dtp div.dtp-year-btn-prev{text-align:right}.dtp div.dtp-year-btn-next{text-align:left}.dtp div.dtp-picker{padding:10px 10px 0 10px;text-align:center;overflow:hidden}.dtp div.dtp-actual-time,.dtp div.dtp-picker-month{font-weight:500;text-align:center}.dtp .dtp-close{position:absolute;top:1px;right:5px;font-size:16px}.dtp .dtp-close>a{color:#fff;text-decoration:none}.dtp .dtp-close>a>i{font-size:1em}.dtp table.dtp-picker-days{margin:0;min-height:220px}.dtp md-virtual-repeat-container.months{height:260px}.dtp table.dtp-picker-days,.dtp table.dtp-picker-days tr,.dtp table.dtp-picker-days tr>td{border:none}.dtp table.dtp-picker-days tr>td{font-size:11px;text-align:center;padding:0}.dtp table.dtp-picker-days tr>td>span.dtp-select-day{color:#bdbdbd!important}.dtp table.dtp-picker-days tr>td,.dtp table.dtp-picker-days tr>td>.dtp-select-day{width:36px;height:36px}.dtp table.dtp-picker-days tr>td>.dtp-select-day{display:inline-block}.dtp .dtp-picker-time>a,.dtp table.dtp-picker-days tr>td>.dtp-select-day{color:#212121;text-decoration:none;padding:10px;border-radius:50%!important}.dtp table.dtp-picker-days tr>td>a.selected{background:#8bc34a;color:#fff}.dtp table.dtp-picker-days tr>td>a.selected.hilite{padding:6px;font-size:16px;font-weight:500;background:#8bc34a;color:#fff}.dtp table.dtp-picker-days tr>td>a.hilite:not(.selected){padding:6px;font-size:16px;font-weight:500;color:#8bc34a}.dtp table.dtp-picker-days tr>td>a:hover:not(.selected){background:#ddd}.dtp table.dtp-picker-days tr>th{color:#757575;text-align:center;font-weight:700;padding:4px 3px;width:38px;height:28px}.dtp .p10>a{color:#689f38;text-decoration:none}.dtp .p10{width:10%;display:inline-block}.dtp .p20{width:20%;display:inline-block}.dtp .p60{width:60%;display:inline-block}.dtp .p80{width:80%;display:inline-block}.dtp div.dtp-picker-datetime{padding-bottom:25px}.dtp span.dtp-actual-meridien{font-size:.6em}.dtp div.dtp-actual-meridien{height:20px}.dtp a.dtp-meridien-am,.dtp a.dtp-meridien-pm{position:relative;color:#212121;font-weight:500;padding:7px 5px;border-radius:50%!important;text-decoration:none;background:#eee;font-size:10px}.dtp .dtp-actual-meridien a.selected{background:#689f38;color:#fff}.dtp .dtp-picker-time>a{display:block;line-height:23px;padding:3px 3px 3px 3px}.dtp .dtp-picker-time{position:absolute;width:30px;height:30px;font-size:1.1em;border-radius:50%;cursor:pointer;text-align:center!important}.dtp .dtp-picker-time>a.dtp-select-hour.selected{background:#689f38;color:#fff}.dtp .dtp-picker-time>a.dtp-select-hour.disabled,.dtp .dtp-picker-time>a.dtp-select-minute.disabled{color:#757575}.dtp .dtp-picker-time>a.dtp-select-minute.selected{background:#8bc34a;color:#fff}.dtp div.dtp-picker-clock{margin:10px 20px 0 20px;padding:10px;border-radius:50%!important;background:#eee;direction:ltr;cursor:default}.dtp-clock-center{width:15px;height:15px;background:#757575;border-radius:50%;position:absolute;z-index:50}.dtp .dtp-hand,.dtp .dtp-hour-hand{position:absolute;width:4px;margin-left:-2px;background:#bdbdbd;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0);-moz-transform-origin:bottom;-ms-transform-origin:bottom;-webkit-transform-origin:bottom;transform-origin:bottom;z-index:1}.dtp .dtp-minute-hand{width:2px;margin-left:-1px}.dtp .dtp-hand.on{background:#8bc34a}.dtp .dtp-buttons{padding-bottom:10px;text-align:right}.dtp .hidden,.dtp.hidden{display:none}.dtp .invisible{visibility:hidden}.dtp .left{float:left}.dtp .right{float:right}.dtp .clearfix{clear:both}.dtp .center{text-align:center}[dir=rtl] .dtp div.dtp-month-btn-next,[dir=rtl] .dtp div.dtp-month-btn-prev,[dir=rtl] .dtp div.dtp-year-btn-next,[dir=rtl] .dtp div.dtp-year-btn-prev{-ms-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg)} \ No newline at end of file +md-dialog.dtp{font-size:14px;line-height:1.42857143;color:#333;background-color:#fff;max-height:none;min-width:300px}.noselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dtp :focus{outline:0!important}.dtp table{border-spacing:0;border-collapse:collapse;width:100%}.dtp .table>tbody>tr>td,.dtp .table>tbody>tr>th,.dtp .table>tfoot>tr>td,.dtp .table>tfoot>tr>th,.dtp .table>thead>tr>td,.dtp .table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.dtp,.dtp *{box-sizing:border-box!important}.dtp>.dtp-content{max-width:300px;max-height:500px}.dtp>.dtp-content>.dtp-date-view>header.dtp-header{background:#689f38;color:#fff;text-align:center}.dtp div.dtp-date,.dtp div.dtp-time{background:#8bc34a;text-align:center;color:#fff;padding:10px}.dtp div.dtp-date>div{padding:0;margin:0}.dtp div.dtp-actual-month{font-size:1.5em}.dtp div.dtp-actual-num{font-size:2em;line-height:.9}.dtp div.dtp-actual-maxtime{font-size:2em;line-height:.9}.dtp div.dtp-actual-year{font-size:1.6em;color:#dcedc8}.dtp div.dtp-month-btn{font-size:1.4em;line-height:30px;cursor:pointer}.dtp div.dtp-month-btn-prev{text-align:right}.dtp div.dtp-month-btn-next{text-align:left}.dtp div.dtp-year-btn{font-size:1.4em;line-height:30px;cursor:pointer;color:#dcedc8}.dtp div.dtp-year-btn-prev{text-align:right}.dtp div.dtp-year-btn-next{text-align:left}.dtp div.dtp-picker{padding:10px 10px 0 10px;text-align:center;overflow:hidden}.dtp div.dtp-actual-time,.dtp div.dtp-picker-month{font-weight:500;text-align:center}.dtp .dtp-close{position:absolute;top:0;right:5px;font-size:16px}.dtp .dtp-close>a{color:#fff;text-decoration:none}.dtp .dtp-close>a>i{font-size:1em}.dtp table.dtp-picker-days{margin:0;min-height:220px}.dtp md-virtual-repeat-container.months{height:260px}.dtp table.dtp-picker-days,.dtp table.dtp-picker-days tr,.dtp table.dtp-picker-days tr>td{border:none}.dtp table.dtp-picker-days tr>td{font-size:11px;text-align:center;padding:0}.dtp table.dtp-picker-days tr>td>span.dtp-select-day{color:#bdbdbd!important}.dtp table.dtp-picker-days tr>td,.dtp table.dtp-picker-days tr>td>.dtp-select-day{width:36px;height:36px}.dtp table.dtp-picker-days tr>td>.dtp-select-day{display:inline-block}.dtp .dtp-picker-time>a,.dtp table.dtp-picker-days tr>td>.dtp-select-day{color:#212121;text-decoration:none;padding:10px;border-radius:50%!important}.dtp table.dtp-picker-days tr>td>a.selected{background:#8bc34a;color:#fff}.dtp table.dtp-picker-days tr>td>a.selected.hilite{padding:6px;font-size:16px;font-weight:500;background:#8bc34a;color:#fff}.dtp table.dtp-picker-days tr>td>a.hilite:not(.selected){padding:6px;font-size:16px;font-weight:500;color:#8bc34a}.dtp table.dtp-picker-days tr>td>a:hover:not(.selected){background:#ddd}.dtp table.dtp-picker-days tr>th{color:#757575;text-align:center;font-weight:700;padding:4px 3px;width:38px;height:28px}.dtp .p10>a{color:#689f38;text-decoration:none}.dtp .p10{width:10%;display:inline-block}.dtp .p20{width:20%;display:inline-block}.dtp .p60{width:60%;display:inline-block}.dtp .p80{width:80%;display:inline-block}.dtp div.dtp-picker-datetime{padding-bottom:25px}.dtp span.dtp-actual-meridien{font-size:.6em}.dtp div.dtp-actual-meridien{height:20px}.dtp a.dtp-meridien-am,.dtp a.dtp-meridien-pm{position:relative;color:#212121;font-weight:500;padding:7px 5px;border-radius:50%!important;text-decoration:none;background:#eee;font-size:10px}.dtp .dtp-actual-meridien a.selected{background:#689f38;color:#fff}.dtp .dtp-picker-time>a{display:block;line-height:23px;padding:3px 3px 3px 3px}.dtp .dtp-picker-time{position:absolute;width:30px;height:30px;font-size:1.1em;border-radius:50%;cursor:pointer;text-align:center!important}.dtp .dtp-picker-time>a.dtp-select-hour.selected{background:#689f38;color:#fff}.dtp .dtp-picker-time>a.dtp-select-hour.disabled,.dtp .dtp-picker-time>a.dtp-select-minute.disabled{color:#757575}.dtp .dtp-picker-time>a.dtp-select-minute.selected{background:#8bc34a;color:#fff}.dtp div.dtp-picker-clock{margin:10px 20px 0 20px;padding:10px;border-radius:50%!important;background:#eee;direction:ltr;cursor:default}.dtp-clock-center{width:15px;height:15px;background:#757575;border-radius:50%;position:absolute;z-index:50}.dtp .dtp-hand,.dtp .dtp-hour-hand{position:absolute;width:4px;margin-left:-2px;background:#bdbdbd;-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0);-moz-transform-origin:bottom;-ms-transform-origin:bottom;-webkit-transform-origin:bottom;transform-origin:bottom;z-index:1}.dtp .dtp-minute-hand{width:2px;margin-left:-1px}.dtp .dtp-hand.on{background:#8bc34a}.dtp .dtp-buttons{padding-bottom:10px;text-align:right}.dtp .hidden,.dtp.hidden{display:none}.dtp .invisible{visibility:hidden}.dtp .left{float:left}.dtp .right{float:right}.dtp .clearfix{clear:both}.dtp .center{text-align:center}[dir=rtl] .dtp div.dtp-month-btn-next,[dir=rtl] .dtp div.dtp-month-btn-prev,[dir=rtl] .dtp div.dtp-year-btn-next,[dir=rtl] .dtp div.dtp-year-btn-prev{-ms-transform:rotate(180deg);-webkit-transform:rotate(180deg);transform:rotate(180deg)} \ No newline at end of file diff --git a/package.json b/package.json index f33e1e6..95a47b5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng-material-datetimepicker", "description": "A datetime picker for AngularJS Material", - "version": "1.7.0", + "version": "1.7.1", "keywords": [ "css", "js",