greatCodeIdeas / md-date-range-picker

Angular Material Date Range Picker Service/Directive
MIT License
62 stars 40 forks source link

How to disable the future dates? #24

Closed vishnu-vv closed 7 years ago

vishnu-vv commented 7 years ago

If there is already an option to do this, please make the reference doc much more informative by including those options.

roelbarreto commented 7 years ago

Hi @vishnu-vv Thanks for pointing out this. We already have this feature https://github.com/greatCodeIdeas/md-date-range-picker/blob/1a8cf8a8f82c44d6d35808711d35c5ebf611c7d0/demo/index.html#L44 We can add it to the docu.

<md-date-range-picker is-disabled-date="isFuture($date)"></md-date-range-picker>

$scope.isFuture= function ($date) {
   return $date.getTime() > new Date().getTime();
}
roelbarreto commented 7 years ago

Reference Commit https://github.com/greatCodeIdeas/md-date-range-picker/commit/45cd579ede559d430409564f04eda9bcbb220861 https://github.com/greatCodeIdeas/md-date-range-picker/commit/93e99c62859df22ed3b22640e2b6e22b38f01457