From 541ff02a843d6cfeb8e651075382557ba109794a Mon Sep 17 00:00:00 2001 From: Michel Couillard Date: Sun, 30 Jul 2017 23:29:18 -0400 Subject: [PATCH] fix #105 weekDays param --- README.md | 4 +++ dist/angular-material-datetimepicker.min.js | 2 +- ...angular-material-datetimepicker.min.js.map | 2 +- index.html | 27 ++++++++++++------- js/angular-material-datetimepicker.js | 14 ++++++++++ package.json | 8 +++--- yarn.lock | 24 ++++++++--------- 7 files changed, 54 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 33f5ce7..ad5deb9 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Originally designed for Bootstrap Material, this has been modified to work with - Configurable first day of the week - Support 24-hour format display - Can disable dates, not selectable by user +- Highlight Week days (Business Days) - Can disable minutes view - 1 to 59 minute steps (normally 1, 5, 10, 15) - Compatible with right-to-left direction @@ -17,6 +18,7 @@ Originally designed for Bootstrap Material, this has been modified to work with | Date | Author | Description | | ---------- | -------- | ------------------------------------------------------ | +| 2017-07-30 | hexadecy | Highlight only week-days (business days) | | 2017-07-22 | hexadecy | Mouse or touch move to select time, minute steps param | | 2017-04-26 | hexadecy | New 24-hour clock face | | 2017-04-17 | hexadecy | Single click to select | @@ -118,6 +120,7 @@ The directive accepts several attributes which are described below: | **ok-text** | String | Text for the OK button (default: OK) | | **week-start** | Number | First day of the week (default: 0 => Sunday) | | **disable-dates** | Date[] | Dates to be disabled or not selectable by user. | +| **week-days** | Boolean | true => Highlight only week-days (default: false) | | **show-todays-date** | Attribute | Show today's date (default: undefined) | | **disable-parent-scroll** | Boolean | true => Disable scrolling while the dialog is open (default : false) | | **auto-ok** | Boolean | true => Single click (default: false) | @@ -170,6 +173,7 @@ The `mdcDateTimeDialog.show` accepts the same options as the directive. amText: {string} ='AM', pmText: {string} ='PM', disableDates: {date[]} =[], + weekDays: {boolean} =false, disableParentScroll: {boolean} = false, autoOk: {boolean} =false, editInput: {boolean} =false, diff --git a/dist/angular-material-datetimepicker.min.js b/dist/angular-material-datetimepicker.min.js index 721420d..e43db83 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;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)}(); +!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:[],weekDays:!1,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:"=",weekDays:"=",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),this.weekDays=this.params.weekDays},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)},isWeekDay:function(t){return!this.weekDays||t.isoWeekday()<=5},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,D=parseInt(i(c,"paddingTop").replace("px",""))||0,v=parseInt(i(t,"marginLeft").replace("px",""))||0,k=parseInt(i(t,"marginTop").replace("px",""))||0,g=m/2,M=g/1.2,y=[],x=0;x<12;++x){var b=g+M*Math.sin(2*Math.PI*(x/12))+h/2-(h+v),T=g-M*Math.cos(2*Math.PI*(x/12))-k/2-(D+k),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=g/1.8,P=12;P<24;++P){var S=g+A*Math.sin(2*Math.PI*(P/12))+h/2-(h+v),Y=g-A*Math.cos(2*Math.PI*(P/12))-k/2-(D+k),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=g/(s.params.shortTime?1.8:2.3),C=g/1.5;angular.element(a[0].querySelector(".dtp-hour-hand")).css({left:g+1.5*v+"px",height:N+"px",marginTop:g-N-h+"px"}).addClass(n?"":"on"),angular.element(a[0].querySelector(".dtp-minute-hand")).css({left:g+1.5*v+"px",height:C+"px",marginTop:g-C-h+"px"}).addClass(n?"on":""),angular.element(V).css({left:g+h+v-E+"px",marginTop:g-v/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 D=e.$watch(function(){return a[0].querySelectorAll("div").length},function(){m(),D()})}}}]),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 30e9760..1471a64 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","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,OA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AAQC,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 +{"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","weekDays","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","isWeekDay","isoWeekday","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","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,GAyBxE,OAvBEC,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,UAAU,EACVC,qBAAqB,EACrBC,QAAQ,EACRC,WAAW,EACXC,qBAAqB,EACrBC,YAAa,MAIhBC,UAAU,qBAAsB,YAAa,WAC5C,SAAUC,E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AAQ/M,EAAMoR,cAChB1H,EAAOpB,KAEToB,EAAO/K,YAAYmG,OAAOiI,KApBtBA,IAAQ/M,EAAMoR,cAAiB1H,EAAO1F,OAAOzE,QAC/CmK,EAAOpB,KAGLoB,EAAO1F,OAAOlF,UAChB4K,EAAO/K,YAAYyH,KAAKsD,EAAOnC,OAAUwF,EAAM,GAAMA,IAErDrD,EAAO/K,YAAYyH,KAAK2G,GACTrD,EAAOzF,SAAlB8I,GAAO,GAAsB,KACV,MAGrBrD,EAAO1F,OAAOzE,QAChBmK,EAAOpB,MASXoB,EAAO/K,YAAY0H,OAAO,IAG5BrG,EAAMuR,eAAiB,SAAUC,GAC/B,OAAO/E,EAAa/C,EAAOtB,kBAAkBoJ,EAAMvQ,OAASyI,EAAOxB,gBAAgBsJ,EAAMvQ,QAG3F,IAAIwQ,EAAYzR,EAAM2K,OAAO,WAC3B,OAAOtN,EAAQ,GAAGqU,iBAAiB,OAAOpK,QACzC,WACDoH,IACA+C,WAKH7U,EAGT,IAAI+U,EAAarU,QAAUA,OAAOsU,SAAWtU,OAAOsU,QAAQC,KACtC,mBAAXC,QAAyBA,OAAOC,IACzCD,QAAQ,UAAWpV,GACQ,oBAAXe,QAA0BA,QAAUA,OAAOuU,SAA+B,mBAAZjS,UAA4B4R,EAC1GlU,OAAOuU,QAAUtV,EAAqBqD,QAAQ,WAE9CrD,GAAwC,oBAAXuV,OAAyBA,OAAS3U,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 weekDays: false,\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 weekDays: '=',\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 weekDays: {boolean} =false,\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 this.weekDays = this.params.weekDays;\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 isWeekDay: function(date) {\r\n if (this.weekDays) {\r\n if (date.isoWeekday() <= 5) {\r\n return true;\r\n }\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.isWeekDay(moment(date)) &&\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/index.html b/index.html index c9fb3d4..de53270 100644 --- a/index.html +++ b/index.html @@ -8,20 +8,20 @@ - + - - - + + + - - + + - - - + + + @@ -175,6 +175,15 @@

Datetime Pickers

+
+ + + + +
+
+

mdcDateTimeDialog Service

diff --git a/js/angular-material-datetimepicker.js b/js/angular-material-datetimepicker.js index e484ee0..6de071e 100644 --- a/js/angular-material-datetimepicker.js +++ b/js/angular-material-datetimepicker.js @@ -98,6 +98,7 @@ function ngMaterialDatePicker(moment) { pmText: 'PM', todayText: 'Today', disableDates: [], + weekDays: false, disableParentScroll: false, autoOk: false, editInput: false, @@ -121,6 +122,7 @@ function ngMaterialDatePicker(moment) { minDate: '=', maxDate: '=', disableDates: '=', + weekDays: '=', shortTime: '=', weekStart: '=', format: '@', @@ -253,6 +255,7 @@ function ngMaterialDatePicker(moment) { amText: {string} ='AM', pmText: {string} ='PM', disableDates: {date[]} =[], + weekDays: {boolean} =false, disableParentScroll: {boolean} =false, autoOk: {boolean} =false, editInput: {boolean} =false, @@ -374,6 +377,7 @@ function ngMaterialDatePicker(moment) { return moment(x).format('MMMM Do YYYY'); }); this.selectDate(this.currentDate); + this.weekDays = this.params.weekDays; }, initDate: function () { this.currentView = VIEW_STATES.DATE; @@ -457,6 +461,15 @@ function ngMaterialDatePicker(moment) { } return true; }, + isWeekDay: function(date) { + if (this.weekDays) { + if (date.isoWeekday() <= 5) { + return true; + } + return false; + } + return true; + }, selectDate: function (date) { if (date) { this.currentDate = moment(date); @@ -766,6 +779,7 @@ function ngMaterialDatePicker(moment) { calendar.isInRange = function (date) { return picker.isAfterMinDate(moment(date), false, false) && picker.isBeforeMaxDate(moment(date), false, false) && + picker.isWeekDay(moment(date)) && picker.isInDisableDates(moment(date)); }; diff --git a/package.json b/package.json index 95a47b5..a9e1008 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "homepage": "https://beenote.github.io/angular-material-datetimepicker/", "main": "js/angular-material-datetimepicker.js", "dependencies": { - "angular": "^1.6.4", - "angular-animate": "^1.6.4", - "angular-aria": "^1.6.4", + "angular": "^1.6.5", + "angular-animate": "^1.6.5", + "angular-aria": "^1.6.5", "angular-material": "^1.1.4", "moment": "^2.18.1" }, @@ -38,7 +38,7 @@ "gulp-tag-version": "^1.3.0", "gulp-uglify": "^3.0.0", "pump": "^1.0.2", - "run-sequence": "^2.0.0", + "run-sequence": "^2.1.0", "yargs": "^8.0.2" } } diff --git a/yarn.lock b/yarn.lock index 9cf2cb8..51e9d15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31,21 +31,21 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -angular-animate@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/angular-animate/-/angular-animate-1.6.4.tgz#d3eb906d39834f2dfbdd982e6b8d7a3b4d9001d2" +angular-animate@^1.6.5: + version "1.6.5" + resolved "https://registry.yarnpkg.com/angular-animate/-/angular-animate-1.6.5.tgz#3817c75880d05fc899a6c8d4b09d1cc62a71e93a" -angular-aria@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/angular-aria/-/angular-aria-1.6.4.tgz#c8683666ace196668f68e7220811bdcfc9e106e4" +angular-aria@^1.6.5: + version "1.6.5" + resolved "https://registry.yarnpkg.com/angular-aria/-/angular-aria-1.6.5.tgz#37d9d35349df57934968dc7e1679d97ea96f863c" angular-material@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/angular-material/-/angular-material-1.1.4.tgz#27de35646f54ccd320080af0c708e1b438af87f6" -angular@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.4.tgz#03b7b15c01a0802d7e2cf593240e604054dc77fb" +angular@^1.6.5: + version "1.6.5" + resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.5.tgz#37f788eebec5ce2e3fa02b17bbcb2a231576a0d6" ansi-cyan@^0.1.1: version "0.1.1" @@ -1742,9 +1742,9 @@ resolve@^1.1.6, resolve@^1.1.7: version "1.2.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" -run-sequence@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/run-sequence/-/run-sequence-2.0.0.tgz#6ab754fe53cd771d47dbdee63c254882344d5896" +run-sequence@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/run-sequence/-/run-sequence-2.1.0.tgz#149da012516f21dcf79db6dc99a2a95603631b21" dependencies: chalk "^1.1.3" gulp-util "^3.0.8"