Initial commit

This commit is contained in:
Senad Uka
2018-06-11 11:09:35 +02:00
commit ed7df7b11f
1954 changed files with 483354 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
(function () {
global.dashModule
.directive('datepicker', ['$timeout', '$', datepickerDirective]);
function datepickerDirective($timeout, $) {
return {
restrict: 'A',
require: 'ngModel',
scope: {
onDateSelected: '=',
elementData: '='
},
transclude: true,
link: function ($scope, $element, $attrs, ngModelCtrl) {
$timeout(function () {
$($element).datepicker({
dateFormat: 'yy-mm-dd',
showButtonPanel: true,
changeYear: true,
onSelect: function (date) {
ngModelCtrl.$setViewValue(date);
$scope.$apply();
},
onClose: function (date) {
if(typeof $scope.onDateSelected !== 'undefined' && date){
$scope.onDateSelected(date, $scope.elementData);
}
}
});
});
}
};
}
})();