-
-
Notifications
You must be signed in to change notification settings - Fork 355
Closed
Description
I have two ionic-datepicker object: "start" and "end", I want that when someone change "end" date the start date change his from parameter according to end date minus some months. I create a watch to the value but when I change from parameter the view doesn't change according new value.
$scope.$watch('endDate.inputDate', function (value) {
if (value && $scope.maxMonths){
var newStartDate = new Date(value);
newStartDate.setMonth(newStartDate.getMonth() - $scope.maxMonths);
$scope.startDate.from = newStartDate;
if ($scope.StartDate.inputDate < newStartDate){
$scope.startDate.inputDate = null;
}
}
});
Metadata
Metadata
Assignees
Labels
No labels