angular-ui / ui-date

jQuery UI Datepicker for AngularJS
http://angular-ui.github.io/ui-date/
MIT License
266 stars 207 forks source link

maxDate and minDate with dateOptions #133

Closed fsebbah closed 8 years ago

fsebbah commented 9 years ago

Hi, I follow the directive in the issue #51 , its 'great but if we define a $scope.dateOptions, how it's possible to define both in the directive ui-date. For sample: <input ui-date="dateOptions {max:endDate} ng-model="startDate"> <input ui-date="dateOptions {min:endDate max:0} ng-model="startDate"> Thanks, Franck

alexanderchan commented 8 years ago
<input type="text" id="date" ui-date="dateOptions" ng-model="aDate">
angular.module('MyModule', ['ui.date']).controller('MyCtrl', function($scope) {
          $scope.aDate = '2015-10-27';
          $scope.dateOptions = {
            dateFormat: 'yy-mm-dd',
            minDate: new Date(),
            maxDate: new Date('2016-01-01')
          }
      })