diff options
author | DushyantSinghThakur <dt00503496@techmahindra.com> | 2018-09-06 12:46:04 +0530 |
---|---|---|
committer | Dan Timoney <dt5972@att.com> | 2018-09-12 13:10:46 +0000 |
commit | 43d4b00848ebd0567b020fe219f07d4f7049ff0b (patch) | |
tree | f5c09d0006348c82a94693605349e79db4889b71 /configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker | |
parent | 4e2db0d6e56bc19425e6afa3efc7011820942e9e (diff) |
Epic-231:versioning, and backup the configuration
Merging the sdnc jira stories- 255,256
Change-Id: Iacb9274dae93f534f1331c4eb7d0669896d379d4
Issue-ID: SDNC-256
Signed-off-by: DushyantSinghThakur <dt00503496@techmahindra.com>
Former-commit-id: 94d8b3d82b82dedfd5949da2e5d1ed348ab066e2
Diffstat (limited to 'configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker')
3 files changed, 407 insertions, 0 deletions
diff --git a/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.css b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.css new file mode 100644 index 00000000..240be45b --- /dev/null +++ b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.css @@ -0,0 +1,74 @@ +.angularjs-datetime-picker { + color: #333; + font: normal 14px sans-serif; + border: 1px solid #ddd; + display: inline-block; + background: #fff; +} +.angularjs-datetime-picker > .adp-month { + text-align: center; + line-height: 22px; + padding: 10px; + background: #fcfcfc; + text-transform: uppercase; + font-weight: bold; + border-bottom: 1px solid #ddd; + position: relative; +} +.angularjs-datetime-picker > .adp-month > button { + color: #555; + font: normal 14px sans-serif; + outline: none; + position: absolute; + background: transparent; + border: none; + cursor: pointer; +} +.angularjs-datetime-picker > .adp-month > button:hover { + color: #333; +} +.angularjs-datetime-picker > .adp-month > button.adp-prev { + left: 10px; +} +.angularjs-datetime-picker > .adp-month > button.adp-next { + right: 10px; +} +.angularjs-datetime-picker > .adp-days { + width: 210px; /* 30 x 7 */ + margin: 10px; + text-align: center; +} +.angularjs-datetime-picker > .adp-days > .adp-day-of-week, .angularjs-datetime-picker > .adp-days > .adp-day { + box-sizing: border-box; + -moz-box-sizing: border-box; + border: 1px solid transparent; + width: 30px; + line-height: 28px; + float: left; +} +.angularjs-datetime-picker > .adp-days > .adp-day-of-week { + font-weight: bold; +} +.angularjs-datetime-picker > .adp-days > .adp-day:not(.selectable) { + opacity: 0.15; + cursor: default; +} +.angularjs-datetime-picker > .adp-days > .adp-day.selectable { + cursor: pointer; +} +.angularjs-datetime-picker > .adp-days > .adp-day.selected { + background: #e0e0e0; +} +.angularjs-datetime-picker > .adp-days > .adp-day.selectable:hover { + background: #eee; +} +.angularjs-datetime-picker > .adp-days:after { + content: ''; + display: block; + clear: left; + height: 0; +} + +.angularjs-datetime-picker input[type=range] { + width: 150px; +} diff --git a/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.js b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.js new file mode 100644 index 00000000..946f12e8 --- /dev/null +++ b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.js @@ -0,0 +1,332 @@ +(function() { + 'use strict'; + + angular.module('angularjs-datetime-picker', []); + + var getTimezoneOffset = function(date) { + (typeof date == 'string') && (date = new Date(date)); + var jan = new Date(date.getFullYear(), 0, 1); + var jul = new Date(date.getFullYear(), 6, 1); + var stdTimezoneOffset = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); + var isDST = date.getTimezoneOffset() < stdTimezoneOffset; + var offset = isDST ? stdTimezoneOffset - 60 : stdTimezoneOffset; + var diff = offset >=0 ? '-' : '+'; + return diff + + ("0"+ (offset / 60)).slice(-2) + ':' + + ("0"+ (offset % 60)).slice(-2); + }; + + var DatetimePicker = function($compile, $document, $controller){ + var datetimePickerCtrl = $controller('DatetimePickerCtrl'); //directive controller + return { + open: function(options) { + datetimePickerCtrl.openDatetimePicker(options); + }, + close: function() { + datetimePickerCtrl.closeDatetimePicker(); + } + }; + }; + DatetimePicker.$inject = ['$compile', '$document', '$controller']; + angular.module('angularjs-datetime-picker').factory('DatetimePicker', DatetimePicker); + + var DatetimePickerCtrl = function($compile, $document) { + var datetimePickerEl; + var _this = this; + var removeEl = function(el) { + el && el.remove(); + $document[0].body.removeEventListener('click', _this.closeDatetimePicker); + }; + + this.openDatetimePicker = function(options) { + this.closeDatetimePicker(); + var div = angular.element('<div datetime-picker-popup ng-cloak></div>'); + options.dateFormat && div.attr('date-format', options.dateFormat); + options.ngModel && div.attr('ng-model', options.ngModel); + options.year && div.attr('year', parseInt(options.year)); + options.month && div.attr('month', parseInt(options.month)); + options.day && div.attr('day', parseInt(options.day)); + options.hour && div.attr('hour', parseInt(options.hour)); + options.minute && div.attr('minute', parseInt(options.minute)); + if (options.dateOnly === '' || options.dateOnly === true) { + div.attr('date-only', 'true'); + } + if (options.closeOnSelect === 'false') { + div.attr('close-on-select', 'false'); + } + + var triggerEl = options.triggerEl; + options.scope = options.scope || angular.element(triggerEl).scope(); + datetimePickerEl = $compile(div)(options.scope)[0]; + datetimePickerEl.triggerEl = options.triggerEl; + + $document[0].body.appendChild(datetimePickerEl); + + //show datetimePicker below triggerEl + var bcr = triggerEl.getBoundingClientRect(); + datetimePickerEl.style.position='absolute'; + datetimePickerEl.style.left= (bcr.left + window.scrollX) + 'px'; + + options.scope.$apply(); + + var datePickerElBcr = datetimePickerEl.getBoundingClientRect(); + + if (bcr.top < 300 || window.innerHeight - bcr.bottom > 300) { + datetimePickerEl.style.top = (bcr.bottom + window.scrollY) + 'px'; + } else { + datetimePickerEl.style.top = (bcr.top - datePickerElBcr.height + window.scrollY) + 'px'; + } + + $document[0].body.addEventListener('click', this.closeDatetimePicker); + }; + + this.closeDatetimePicker = function(evt) { + var target = evt && evt.target; + var popupEl = $document[0].querySelector('div[datetime-picker-popup]'); + if (evt && target) { + if (target.hasAttribute('datetime-picker')) { // element with datetimePicker behaviour + // do nothing + } else if (popupEl && popupEl.contains(target)) { // datetimePicker itself + // do nothing + } else { + removeEl(popupEl); + } + } else { + removeEl(popupEl); + } + } + }; + DatetimePickerCtrl.$inject = ['$compile', '$document']; + angular.module('angularjs-datetime-picker').controller('DatetimePickerCtrl', DatetimePickerCtrl); + + var tmpl = [ + '<div class="angularjs-datetime-picker">' , + ' <div class="adp-month">', + ' <button type="button" class="adp-prev" ng-click="addMonth(-1)">«</button>', + ' <span title="{{months[mv.month].fullName}}">{{months[mv.month].shortName}}</span> {{mv.year}}', + ' <button type="button" class="adp-next" ng-click="addMonth(1)">»</button>', + ' </div>', + ' <div class="adp-days" ng-click="setDate($event)">', + ' <div class="adp-day-of-week" ng-repeat="dayOfWeek in ::daysOfWeek" title="{{dayOfWeek.fullName}}">{{::dayOfWeek.firstLetter}}</div>', + ' <div class="adp-day" ng-repeat="day in mv.leadingDays">{{::day}}</div>', + ' <div class="adp-day selectable" ng-repeat="day in mv.days" ', + ' ng-class="{selected: (day == selectedDay)}">{{::day}}</div>', + ' <div class="adp-day" ng-repeat="day in mv.trailingDays">{{::day}}</div>', + ' </div>', + ' <div class="adp-days" id="adp-time"> ', + ' Time : {{("0"+inputHour).slice(-2)}} : {{("0"+inputMinute).slice(-2)}} <br/>', + ' <label>Hour:</label> <input type="range" min="0" max="23" ng-model="inputHour" ng-change="updateNgModel()" />', + ' <label>Min.:</label> <input type="range" min="0" max="59" ng-model="inputMinute" ng-change="updateNgModel()"/> ', + ' </div> ', + '</div>'].join("\n"); + + var datetimePickerPopup = function($locale, dateFilter){ + var days, months, daysOfWeek, firstDayOfWeek; + + var initVars = function() { + days =[], months=[]; daysOfWeek=[], firstDayOfWeek=0; + for (var i = 1; i <= 31; i++) { + days.push(i); + } + + for (var i = 0; i < 12; i++) { //jshint ignore:line + months.push({ + fullName: $locale.DATETIME_FORMATS.MONTH[i], + shortName: $locale.DATETIME_FORMATS.SHORTMONTH[i] + }); + } + + for (var i = 0; i < 7; i++) { //jshint ignore:line + var day = $locale.DATETIME_FORMATS.DAY[(i + firstDayOfWeek) % 7]; + + daysOfWeek.push({ + fullName: day, + firstLetter: day.substr(0, 2) + }); + } + firstDayOfWeek = $locale.DATETIME_FORMATS.FIRSTDAYOFWEEK || 0; + }; + + var getMonthView = function(year, month) { + if (month>11) { + year++; + } else if (month < 0) { + year--; + } + month = (month + 12) % 12; + var firstDayOfMonth = new Date(year, month, 1), + lastDayOfMonth = new Date(year, month + 1, 0), + lastDayOfPreviousMonth = new Date(year, month, 0), + daysInMonth = lastDayOfMonth.getDate(), + daysInLastMonth = lastDayOfPreviousMonth.getDate(), + dayOfWeek = firstDayOfMonth.getDay(), + leadingDays = (dayOfWeek - firstDayOfWeek + 7) % 7 || 7, // Ensure there are always leading days to give context + trailingDays = days.slice(0, 6 * 7 - (leadingDays + daysInMonth)); + if (trailingDays.length > 7) { + trailingDays = trailingDays.slice(0, trailingDays.length-7); + } + + return { + year: year, + month: month, + days: days.slice(0, daysInMonth), + leadingDays: days.slice(- leadingDays - (31 - daysInLastMonth), daysInLastMonth), + trailingDays: trailingDays + }; + }; + + var linkFunc = function(scope, element, attrs, ctrl) { //jshint ignore:line + initVars(); //initialize days, months, daysOfWeek, and firstDayOfWeek; + var dateFormat = attrs.dateFormat || 'short'; + scope.months = months; + scope.daysOfWeek = daysOfWeek; + scope.inputHour; + scope.inputMinute; + + if (scope.dateOnly === true){ + element[0].querySelector('#adp-time').style.display = 'none'; + } + + scope.$applyAsync( function() { + ctrl.triggerEl = angular.element(element[0].triggerEl); + if (attrs.ngModel) { // need to parse date string + var dateStr = ''+ctrl.triggerEl.scope().$eval(attrs.ngModel); + if (dateStr) { + if (!dateStr.match(/[0-9]{2}:/)) { // if no time is given, add 00:00:00 at the end + dateStr += " 00:00:00"; + } + dateStr = dateStr.replace(/([0-9]{2}-[0-9]{2})-([0-9]{4})/,'$2-$1'); //mm-dd-yyyy to yyyy-mm-dd + dateStr = dateStr.replace(/([\/-][0-9]{2,4})\ ([0-9]{2}\:[0-9]{2}\:)/,'$1T$2'); //reformat for FF + dateStr = dateStr.replace(/EDT|EST|CDT|CST|MDT|PDT|PST|UT|GMT/g,''); //remove timezone + dateStr = dateStr.replace(/\s*\(\)\s*/,''); //remove timezone + dateStr = dateStr.replace(/[\-\+][0-9]{2}:?[0-9]{2}$/,''); //remove timezone + dateStr += getTimezoneOffset(dateStr); + var d = new Date(dateStr); + scope.selectedDate = new Date( + d.getFullYear(), + d.getMonth(), + d.getDate(), + d.getHours(), + d.getMinutes(), + d.getSeconds() + ); + } + } + + if (!scope.selectedDate || isNaN(scope.selectedDate.getTime())) { // no predefined date + var today = new Date(); + var year = scope.year || today.getFullYear(); + var month = scope.month ? (scope.month-1) : today.getMonth(); + var day = scope.day || today.getDate(); + var hour = scope.hour || today.getHours(); + var minute = scope.minute || today.getMinutes(); + scope.selectedDate = new Date(year, month, day, hour, minute, 0); + } + scope.inputHour = scope.selectedDate.getHours(); + scope.inputMinute = scope.selectedDate.getMinutes(); + + // Default to current year and month + scope.mv = getMonthView(scope.selectedDate.getFullYear(), scope.selectedDate.getMonth()); + if (scope.mv.year == scope.selectedDate.getFullYear() && scope.mv.month == scope.selectedDate.getMonth()) { + scope.selectedDay = scope.selectedDate.getDate(); + } else { + scope.selectedDay = null; + } + }); + + scope.addMonth = function (amount) { + scope.mv = getMonthView(scope.mv.year, scope.mv.month + amount); + }; + + scope.setDate = function (evt) { + var target = angular.element(evt.target)[0]; + if (target.className.indexOf('selectable')) { + scope.updateNgModel(parseInt(target.innerHTML)); + if (scope.closeOnSelect !== false) { + ctrl.closeDatetimePicker(); + } + } + }; + + scope.updateNgModel = function(day) { + day = day ? day : scope.selectedDate.getDate(); + scope.selectedDate = new Date( + scope.mv.year, scope.mv.month, day, scope.inputHour, scope.inputMinute, 0 + ); + scope.selectedDay = scope.selectedDate.getDate(); + if (attrs.ngModel) { + //console.log('attrs.ngModel',attrs.ngModel); + var elScope = ctrl.triggerEl.scope(), dateValue; + if (elScope.$eval(attrs.ngModel) && elScope.$eval(attrs.ngModel).constructor.name === 'Date') { + dateValue = new Date(dateFilter(scope.selectedDate, dateFormat)); + } else { + dateValue = dateFilter(scope.selectedDate, dateFormat); + } + elScope.$eval(attrs.ngModel + '= date', {date: dateValue}); + } + }; + + scope.$on('$destroy', ctrl.closeDatetimePicker); + }; + + return { + restrict: 'A', + template: tmpl, + controller: 'DatetimePickerCtrl', + replace: true, + scope: { + year: '=', + month: '=', + day: '=', + hour: '=', + minute: '=', + dateOnly: '=', + closeOnSelect: '=' + }, + link: linkFunc + }; + }; + datetimePickerPopup.$inject = ['$locale', 'dateFilter']; + angular.module('angularjs-datetime-picker').directive('datetimePickerPopup', datetimePickerPopup); + + var datetimePicker = function($parse, DatetimePicker) { + return { + // An ngModel is required to get the controller argument + require: 'ngModel', + link: function(scope, element, attrs, ctrl) { + // Attach validation watcher + scope.$watch(attrs.ngModel, function(value) { + if( !value || value == '' ){ + return; + } + // The value has already been cleaned by the above code + var date = new Date(value); + ctrl.$setValidity('date', !date? false : true); + var now = new Date(); + if( attrs.hasOwnProperty('futureOnly') ){ + ctrl.$setValidity('future-only', date < now? false : true); + } + }); + + element[0].addEventListener('click', function() { + DatetimePicker.open({ + triggerEl: element[0], + dateFormat: attrs.dateFormat, + ngModel: attrs.ngModel, + year: attrs.year, + month: attrs.month, + day: attrs.day, + hour: attrs.hour, + minute: attrs.minute, + dateOnly: attrs.dateOnly, + futureOnly: attrs.futureOnly, + closeOnSelect: attrs.closeOnSelect + }); + }); + } + }; + }; + datetimePicker.$inject=['$parse', 'DatetimePicker']; + angular.module('angularjs-datetime-picker').directive('datetimePicker', datetimePicker); + +})(); diff --git a/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.min.js b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.min.js new file mode 100644 index 00000000..bc6c19ac --- /dev/null +++ b/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angularjs-datetime-picker/angularjs-datetime-picker.min.js @@ -0,0 +1 @@ +!function(){"use strict";angular.module("angularjs-datetime-picker",[]);var e=function(e){"string"==typeof e&&(e=new Date(e));var t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),n=Math.max(t.getTimezoneOffset(),a.getTimezoneOffset()),l=e.getTimezoneOffset()<n,r=l?n-60:n,i=r>=0?"-":"+";return i+("0"+r/60).slice(-2)+":"+("0"+r%60).slice(-2)},t=function(e,t,a){var n=a("DatetimePickerCtrl");return{open:function(e){n.openDatetimePicker(e)},close:function(){n.closeDatetimePicker()}}};t.$inject=["$compile","$document","$controller"],angular.module("angularjs-datetime-picker").factory("DatetimePicker",t);var a=function(e,t){var a,n=this,l=function(e){e&&e.remove(),t[0].body.removeEventListener("click",n.closeDatetimePicker)};this.openDatetimePicker=function(n){this.closeDatetimePicker();var l=angular.element("<div datetime-picker-popup ng-cloak></div>");n.dateFormat&&l.attr("date-format",n.dateFormat),n.ngModel&&l.attr("ng-model",n.ngModel),n.year&&l.attr("year",parseInt(n.year)),n.month&&l.attr("month",parseInt(n.month)),n.day&&l.attr("day",parseInt(n.day)),n.hour&&l.attr("hour",parseInt(n.hour)),n.minute&&l.attr("minute",parseInt(n.minute)),(""===n.dateOnly||n.dateOnly===!0)&&l.attr("date-only","true"),"false"===n.closeOnSelect&&l.attr("close-on-select","false");var r=n.triggerEl;n.scope=n.scope||angular.element(r).scope(),a=e(l)(n.scope)[0],a.triggerEl=n.triggerEl,t[0].body.appendChild(a);var i=r.getBoundingClientRect();a.style.position="absolute",a.style.left=i.left+window.scrollX+"px",n.scope.$apply();var o=a.getBoundingClientRect();a.style.top=i.top<300||window.innerHeight-i.bottom>300?i.bottom+window.scrollY+"px":i.top-o.height+window.scrollY+"px",t[0].body.addEventListener("click",this.closeDatetimePicker)},this.closeDatetimePicker=function(e){var a=e&&e.target,n=t[0].querySelector("div[datetime-picker-popup]");e&&a?a.hasAttribute("datetime-picker")||n&&n.contains(a)||l(n):l(n)}};a.$inject=["$compile","$document"],angular.module("angularjs-datetime-picker").controller("DatetimePickerCtrl",a);var n=['<div class="angularjs-datetime-picker">',' <div class="adp-month">',' <button type="button" class="adp-prev" ng-click="addMonth(-1)">«</button>',' <span title="{{months[mv.month].fullName}}">{{months[mv.month].shortName}}</span> {{mv.year}}',' <button type="button" class="adp-next" ng-click="addMonth(1)">»</button>'," </div>",' <div class="adp-days" ng-click="setDate($event)">',' <div class="adp-day-of-week" ng-repeat="dayOfWeek in ::daysOfWeek" title="{{dayOfWeek.fullName}}">{{::dayOfWeek.firstLetter}}</div>',' <div class="adp-day" ng-repeat="day in mv.leadingDays">{{::day}}</div>',' <div class="adp-day selectable" ng-repeat="day in mv.days" ',' ng-class="{selected: (day == selectedDay)}">{{::day}}</div>',' <div class="adp-day" ng-repeat="day in mv.trailingDays">{{::day}}</div>'," </div>",' <div class="adp-days" id="adp-time"> ',' Time : {{("0"+inputHour).slice(-2)}} : {{("0"+inputMinute).slice(-2)}} <br/>',' <label>Hour:</label> <input type="range" min="0" max="23" ng-model="inputHour" ng-change="updateNgModel()" />',' <label>Min.:</label> <input type="range" min="0" max="59" ng-model="inputMinute" ng-change="updateNgModel()"/> '," </div> ","</div>"].join("\n"),l=function(t,a){var l,r,i,o,c=function(){l=[],r=[],i=[],o=0;for(var e=1;31>=e;e++)l.push(e);for(var e=0;12>e;e++)r.push({fullName:t.DATETIME_FORMATS.MONTH[e],shortName:t.DATETIME_FORMATS.SHORTMONTH[e]});for(var e=0;7>e;e++){var a=t.DATETIME_FORMATS.DAY[(e+o)%7];i.push({fullName:a,firstLetter:a.substr(0,2)})}o=t.DATETIME_FORMATS.FIRSTDAYOFWEEK||0},d=function(e,t){t>11?e++:0>t&&e--,t=(t+12)%12;var a=new Date(e,t,1),n=new Date(e,t+1,0),r=new Date(e,t,0),i=n.getDate(),c=r.getDate(),d=a.getDay(),s=(d-o+7)%7||7,u=l.slice(0,42-(s+i));return u.length>7&&(u=u.slice(0,u.length-7)),{year:e,month:t,days:l.slice(0,i),leadingDays:l.slice(-s-(31-c),c),trailingDays:u}},s=function(t,n,l,o){c();var s=l.dateFormat||"short";t.months=r,t.daysOfWeek=i,t.inputHour,t.inputMinute,t.dateOnly===!0&&(n[0].querySelector("#adp-time").style.display="none"),t.$applyAsync(function(){if(o.triggerEl=angular.element(n[0].triggerEl),l.ngModel){var a=""+o.triggerEl.scope().$eval(l.ngModel);if(a){a.match(/[0-9]{2}:/)||(a+=" 00:00:00"),a=a.replace(/([0-9]{2}-[0-9]{2})-([0-9]{4})/,"$2-$1"),a=a.replace(/([\/-][0-9]{2,4})\ ([0-9]{2}\:[0-9]{2}\:)/,"$1T$2"),a=a.replace(/EDT|EST|CDT|CST|MDT|PDT|PST|UT|GMT/g,""),a=a.replace(/\s*\(\)\s*/,""),a=a.replace(/[\-\+][0-9]{2}:?[0-9]{2}$/,""),a+=e(a);var r=new Date(a);t.selectedDate=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds())}}if(!t.selectedDate||isNaN(t.selectedDate.getTime())){var i=new Date,c=t.year||i.getFullYear(),s=t.month?t.month-1:i.getMonth(),u=t.day||i.getDate(),m=t.hour||i.getHours(),g=t.minute||i.getMinutes();t.selectedDate=new Date(c,s,u,m,g,0)}t.inputHour=t.selectedDate.getHours(),t.inputMinute=t.selectedDate.getMinutes(),t.mv=d(t.selectedDate.getFullYear(),t.selectedDate.getMonth()),t.selectedDay=t.mv.year==t.selectedDate.getFullYear()&&t.mv.month==t.selectedDate.getMonth()?t.selectedDate.getDate():null}),t.addMonth=function(e){t.mv=d(t.mv.year,t.mv.month+e)},t.setDate=function(e){var a=angular.element(e.target)[0];a.className.indexOf("selectable")&&(t.updateNgModel(parseInt(a.innerHTML)),t.closeOnSelect!==!1&&o.closeDatetimePicker())},t.updateNgModel=function(e){if(e=e?e:t.selectedDate.getDate(),t.selectedDate=new Date(t.mv.year,t.mv.month,e,t.inputHour,t.inputMinute,0),t.selectedDay=t.selectedDate.getDate(),l.ngModel){var n,r=o.triggerEl.scope();n=r.$eval(l.ngModel)&&"Date"===r.$eval(l.ngModel).constructor.name?new Date(a(t.selectedDate,s)):a(t.selectedDate,s),r.$eval(l.ngModel+"= date",{date:n})}},t.$on("$destroy",o.closeDatetimePicker)};return{restrict:"A",template:n,controller:"DatetimePickerCtrl",replace:!0,scope:{year:"=",month:"=",day:"=",hour:"=",minute:"=",dateOnly:"=",closeOnSelect:"="},link:s}};l.$inject=["$locale","dateFilter"],angular.module("angularjs-datetime-picker").directive("datetimePickerPopup",l);var r=function(e,t){return{require:"ngModel",link:function(e,a,n,l){e.$watch(n.ngModel,function(e){if(e&&""!=e){var t=new Date(e);l.$setValidity("date",t?!0:!1);var a=new Date;n.hasOwnProperty("futureOnly")&&l.$setValidity("future-only",a>t?!1:!0)}}),a[0].addEventListener("click",function(){t.open({triggerEl:a[0],dateFormat:n.dateFormat,ngModel:n.ngModel,year:n.year,month:n.month,day:n.day,hour:n.hour,minute:n.minute,dateOnly:n.dateOnly,futureOnly:n.futureOnly,closeOnSelect:n.closeOnSelect})})}}};r.$inject=["$parse","DatetimePicker"],angular.module("angularjs-datetime-picker").directive("datetimePicker",r)}();
\ No newline at end of file |