Skip to content

Commit

Permalink
Release v0.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
indrimuska committed Sep 25, 2016
1 parent b71b480 commit 855e6c9
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-moment-picker",
"version": "0.6.4",
"version": "0.6.5",
"authors": [
"Indri Muska <indrimuska@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-moment-picker.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Moment Picker - v0.6.4 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
/*! Angular Moment Picker - v0.6.5 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
.moment-picker { position: relative; display: block; }
.moment-picker .moment-picker-contents { cursor: pointer; }
.moment-picker .moment-picker-container { color: #404040; min-width: 15em; background: #fff; padding: 4px; border: 1px solid #f0f3f4; border-radius: 4px; position: absolute;
Expand Down
51 changes: 30 additions & 21 deletions dist/angular-moment-picker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Angular Moment Picker - v0.6.4 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
/*! Angular Moment Picker - v0.6.5 - https://github.com/indrimuska/angular-moment-picker - (c) 2015 Indri Muska - MIT */
(function (angular) {
'use strict';

Expand Down Expand Up @@ -39,7 +39,7 @@
return momentPickerProvider;
})();

var $timeout, $sce, $compile, $window, momentPicker;
var $timeout, $sce, $compile, $log, $window, momentPicker;

var MomentPickerDirective = (function () {

Expand All @@ -60,30 +60,33 @@
}

// Directive
function MomentPickerDirective(timeout, sce, compile, window, momentPickerProvider) {
function MomentPickerDirective(timeout, sce, compile, log, window, momentPickerProvider) {
this.restrict = 'A',
this.scope = {
model: '=momentPicker',
locale: '@?',
format: '@?',
minView: '@?',
maxView: '@?',
startView: '@?',
minDate: '=?',
maxDate: '=?',
disabled: '=?disable',
autoclose: '=?',
today: '=?',
keyboard: '=?',
change: '&?'
model: '=momentPicker',
locale: '@?',
format: '@?',
minView: '@?',
maxView: '@?',
startView: '@?',
minDate: '=?',
maxDate: '=?',
disabled: '=?disable',
autoclose: '=?',
today: '=?',
keyboard: '=?',
change: '&?',
selectable: '&?'
};

$timeout = timeout;
$sce = sce;
$compile = compile;
$log = log;
$window = window;
momentPicker = momentPickerProvider;
}
MomentPickerDirective.prototype.$inject = ['$timeout', '$sce', '$compile', '$window', 'momentPicker'];
MomentPickerDirective.prototype.$inject = ['$timeout', '$sce', '$compile', '$log', '$window', 'momentPicker'];
MomentPickerDirective.prototype.link = function ($scope, $element, $attrs) {
$scope.template = (
'<div class="moment-picker-container {{view.selected}}-view" ' +
Expand Down Expand Up @@ -170,7 +173,13 @@
return !angular.isDefined($scope.maxDateMoment) || value.isBefore($scope.maxDateMoment, precision) || value.isSame($scope.maxDateMoment, precision);
},
isSelectable: function (value, precision) {
return $scope.limits.isAfterOrEqualMin(value, precision) && $scope.limits.isBeforeOrEqualMax(value, precision);
var selectable = true;
try {
if (angular.isFunction($scope.selectable)) selectable = $scope.selectable({ date: value, type: precision });
} catch (e) {
$log.error(e);
}
return $scope.limits.isAfterOrEqualMin(value, precision) && $scope.limits.isBeforeOrEqualMax(value, precision) && selectable;
},
checkValue: function () {
if (!angular.isDefined($scope.valueMoment)) return;
Expand Down Expand Up @@ -698,9 +707,9 @@
return new momentPickerProvider();
}])
.directive('momentPicker', [
'$timeout', '$sce', '$compile', '$window', 'momentPicker',
function ($timeout, $sce, $compile, $window, momentPicker) {
return new MomentPickerDirective($timeout, $sce, $compile, $window, momentPicker);
'$timeout', '$sce', '$compile', '$log', '$window', 'momentPicker',
function ($timeout, $sce, $compile, $log, $window, momentPicker) {
return new MomentPickerDirective($timeout, $sce, $compile, $log, $window, momentPicker);
}
]);

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-moment-picker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 855e6c9

Please sign in to comment.