Skip to content

Commit

Permalink
Added disable-calendar-input option
Browse files Browse the repository at this point in the history
  • Loading branch information
ekulabuhov committed Nov 30, 2017
1 parent b97064c commit d9b70e4
Show file tree
Hide file tree
Showing 3 changed files with 789 additions and 9 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "ng-bs-daterangepicker-startapp",
"description": "AngularJS directive for bootstrap-daterangepicker",
"version": "0.0.21",
"version": "0.0.23",
"filename": "./src/ng-bs-daterangepicker.js",
"homepage": "http://github.com/startappadev/ng-bs-daterangepicker",
"main": "src/ng-bs-daterangepicker.js",
"author": {
"name": "Luis Farzati",
"email": "[email protected]",
Expand All @@ -27,11 +28,13 @@
"url": "http://github.com/luisfarzati/ng-bs-daterangepicker/issues"
},
"dependencies": {
"jquery": "^3.2.1",
"moment": "^2.19.3"
},
"devDependencies": {
"grunt": "latest",
"grunt-karma": "latest",
"grunt-contrib-jshint": "latest",
"grunt-contrib-uglify": "latest"
"grunt-contrib-uglify": "latest",
"grunt-karma": "latest"
}
}
8 changes: 2 additions & 6 deletions src/ng-bs-daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
options.opens = $attributes.opens && $parse($attributes.opens)($scope);
options.showCustomRangeLabel = $attributes.showCustomRangeLabel && $parse($attributes.showCustomRangeLabel)($scope);
options.onApply = $attributes.onApply && $parse($attributes.onApply)($scope);
options.disableCalendarInput = $attributes.disableCalendarInput && $parse($attributes.disableCalendarInput)($scope);

function translateRangeText(rangeName) {
var range = rangeName.replace(/ /g, '_');
Expand Down Expand Up @@ -81,20 +82,15 @@
};

var afterDateChoosen = function (start, end, label) {
const labelText = $(label).text();
var labelText = $(label).text();

if (options.onApply) {
options.onApply({startDate: start, endDate: end, label: labelText});
}

$scope.$apply(function () {
//if (dateValid({startDate: start, endDate: end})) {
ngModel.$setViewValue({startDate: start, endDate: end, label: labelText});
ngModel.$render();
// }
//else {
// buildValidation();
// }
});
};
// invoke the jquery plugin and supply the callback, cache the controller object
Expand Down
Loading

0 comments on commit d9b70e4

Please sign in to comment.