4

I have 2 dates : StartDate and EndDate using angular-ui-bootstrap datepicker

When I choose a startDate (greater than today date) I set the min-date of EndDate datepicker at the startDate. So all dates <= startDate are disabled.

But the Today button in popup of EnDate can set today date which is not conform business rule.

Is there a way to disable the the Today button without disabling all the button-bar?

1

2 Answers 2

2

Sample HTMl for that:

ng-model , ng-change and min-date

<input type="text" uib-datepicker-popup="dd/MM/yyyy" ng-model="personForm.StartDate" name="startDate" ng-change="myStartDateChange()" />

<input type="text" uib-datepicker-popup="dd/MM/yyyy" min-date="endmindate" ng-model="personForm.EndDate" name="endDate" />

add function in your controller:

 $scope.myStartDateChange = function () {            
        $scope.endmindate= $scope.personForm.StartDate;
    }
Sign up to request clarification or add additional context in comments.

Comments

0

you should update ui-bootstrap version to 0.14.0 or laster. it could be fix this bug. https://github.com/angular-ui/bootstrap/pull/4199

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.