Thomas.Benz
Thomas.Benz

Reputation: 8599

How to enable all dates

I am using the angular ui datepicker widget from the angular ui bootstrap library (http://angular-ui.github.io/bootstrap/). By default, the datepicker only allows today or later dates to be enabled. All dates before today are disabled. I would like all dates on the datepicker to be enabled. How can I do that? Please advise.

The following site shows how to disable weekends only. http://angular-ui.github.io/bootstrap/

I change the scope function (from that site) so all weekends are enabled. But all dates (weekdays and weekends) before today are still disabled.

My code update for controller for the $scope.disabled() function :

$scope.disabled = function (date, mode) {
       return false;
   };

Here is my markup with the datepicker widget:

<input type="text" id="textSearchUpdatedDate"
                           uib-datepicker-popup="{{format}}" ng-model="updatedDateChangeText" 
                           ng-change="searchUpdatedDateChanged()" ng-keyup="searchUpdatedDateChanged()"
                           is-open="status.opened"
                           min-date="minDate"
                           max-date="maxDate"
                           datepicker-options="dateOptions"
                           date-disabled="disabled(date, mode)"
                           ng-required="true" 
                           close-text="Close" />
                    <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>

Upvotes: 0

Views: 787

Answers (1)

Iamisti
Iamisti

Reputation: 1710

Removing the min-date and the max-date attributes might help.

Upvotes: 2

Related Questions