All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.angular-bootstrap-datetimepicker.src.js.datetimepicker.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
(function(root,factory){"use strict";if(typeof module!=="undefined"&&module.exports){var ng=typeof angular==="undefined"?require("angular"):angular;var mt=typeof moment==="undefined"?require("moment"):moment;factory(ng,mt);module.exports="ui.bootstrap.datetimepicker"}else if(typeof define==="function"&&define.amd){define(["angular","moment"],factory)}else{factory(root.angular,root.moment)}})(this,function(angular,moment){"use strict";angular.module("ui.bootstrap.datetimepicker",[]).service("dateTimePickerConfig",DateTimePickerConfigProvider).service("dateTimePickerValidator",DateTimePickerValidatorService).directive("datetimepicker",DatetimepickerDirective);DatetimepickerDirective.$inject=["dateTimePickerConfig","dateTimePickerValidator"];function DatetimepickerDirective(defaultConfig,configurationValidator){var directiveDefinition={bindToController:false,controller:DirectiveController,controllerAs:"dateTimePickerController",replace:true,require:"ngModel",restrict:"E",scope:{beforeRender:"&",onSetTime:"&"},templateUrl:"templates/datetimepicker.html"};DirectiveController.$inject=["$scope","$element","$attrs"];function DirectiveController($scope,$element,$attrs){var ngModelController=$element.controller("ngModel");var configuration=createConfiguration();$scope.screenReader=configuration.screenReader;$scope.changeView=changeView;ngModelController.$render=$render;if(configuration.configureOn){$scope.$on(configuration.configureOn,function(){configuration=createConfiguration();$scope.screenReader=configuration.screenReader;ngModelController.$render()})}if(configuration.renderOn){$scope.$on(configuration.renderOn,ngModelController.$render)}var viewToModelFactory={year:yearModelFactory,month:monthModelFactory,day:dayModelFactory,hour:hourModelFactory,minute:minuteModelFactory,setTime:setTime};function changeView(viewName,dateObject,event){if(event){event.stopPropagation();event.preventDefault()}if(viewName&&dateObject.utcDateValue>-Infinity&&dateObject.selectable&&viewToModelFactory[viewName]){var result=viewToModelFactory[viewName](dateObject.utcDateValue);var weekDates=[];if(result.weeks){for(var i=0;istartDecade+9,past:yearMoment.year()=0}).forEach(function(key){this[key]=constructorObject[key]},this)}return directiveDefinition}function DateTimePickerConfigProvider(){var defaultConfiguration={configureOn:null,dropdownSelector:null,minuteStep:5,minView:"minute",modelType:"Date",parseFormat:"YYYY-MM-DDTHH:mm:ss.SSSZZ",renderOn:null,startView:"day"};var defaultLocalization={bg:{previous:"предишна",next:"следваща"},ca:{previous:"anterior",next:"següent"},da:{previous:"forrige",next:"næste"},de:{previous:"vorige",next:"weiter"},"en-au":{previous:"previous",next:"next"},"en-gb":{previous:"previous",next:"next"},en:{previous:"previous",next:"next"},"es-us":{previous:"atrás",next:"siguiente"},es:{previous:"atrás",next:"siguiente"},fi:{previous:"edellinen",next:"seuraava"},fr:{previous:"précédent",next:"suivant"},hu:{previous:"előző",next:"következő"},it:{previous:"precedente",next:"successivo"},ja:{previous:"前へ",next:"次へ"},ml:{previous:"മുൻപുള്ളത്",next:"അടുത്തത്"},nl:{previous:"vorige",next:"volgende"},pl:{previous:"poprzednia",next:"następna"},"pt-br":{previous:"anteriores",next:"próximos"},pt:{previous:"anterior",next:"próximo"},ro:{previous:"anterior",next:"următor"},ru:{previous:"предыдущая",next:"следующая"},sk:{previous:"predošlá",next:"ďalšia"},sv:{previous:"föregående",next:"nästa"},tr:{previous:"önceki",next:"sonraki"},uk:{previous:"назад",next:"далі"},"zh-cn":{previous:"上一页",next:"下一页"},"zh-tw":{previous:"上一頁",next:"下一頁"}};var screenReader=defaultLocalization[moment.locale().toLowerCase()];return angular.extend({},defaultConfiguration,{screenReader:screenReader})}DateTimePickerValidatorService.$inject=["$log"];function DateTimePickerValidatorService($log){return{validate:validator};function validator(configuration){var validOptions=["configureOn","dropdownSelector","minuteStep","minView","modelType","parseFormat","renderOn","startView","screenReader"];var invalidOptions=Object.keys(configuration).filter(function(key){return validOptions.indexOf(key)<0});if(invalidOptions.length){throw new Error("Invalid options: "+invalidOptions.join(", "))}var validViews=["minute","hour","day","month","year"];if(validViews.indexOf(configuration.startView)<0){throw new Error("invalid startView value: "+configuration.startView)}if(validViews.indexOf(configuration.minView)<0){throw new Error("invalid minView value: "+configuration.minView)}if(validViews.indexOf(configuration.minView)>validViews.indexOf(configuration.startView)){throw new Error("startView must be greater than minView")}if(!angular.isNumber(configuration.minuteStep)){throw new Error("minuteStep must be numeric")}if(configuration.minuteStep<=0||configuration.minuteStep>=60){throw new Error("minuteStep must be greater than zero and less than 60")}if(configuration.configureOn!==null&&!angular.isString(configuration.configureOn)){throw new Error("configureOn must be a string")}if(configuration.configureOn!==null&&configuration.configureOn.length<1){throw new Error("configureOn must not be an empty string")}if(configuration.renderOn!==null&&!angular.isString(configuration.renderOn)){throw new Error("renderOn must be a string")}if(configuration.renderOn!==null&&configuration.renderOn.length<1){throw new Error("renderOn must not be an empty string")}if(configuration.modelType!==null&&!angular.isString(configuration.modelType)){throw new Error("modelType must be a string")}if(configuration.modelType!==null&&configuration.modelType.length<1){throw new Error("modelType must not be an empty string")}if(configuration.modelType!=="Date"&&configuration.modelType!=="moment"&&configuration.modelType!=="milliseconds"){configuration.parseFormat=configuration.modelType}if(configuration.dropdownSelector!==null&&!angular.isString(configuration.dropdownSelector)){throw new Error("dropdownSelector must be a string")}if(configuration.dropdownSelector!==null&&(typeof jQuery==="undefined"||typeof jQuery().dropdown!=="function")){$log.error("Please DO NOT specify the dropdownSelector option unless you are using jQuery AND Bootstrap.js. "+"Please include jQuery AND Bootstrap.js, or write code to close the dropdown in the on-set-time callback. \n\n"+"The dropdownSelector configuration option is being removed because it will not function properly.");delete configuration.dropdownSelector}}}});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy