Reputation: 71
I am using "pickaday" directive in AngularJS.
My requirement is to disable current and future dates so that the user is not able to select them. I have applied error on selecting future dates but not able to disable them.
Upvotes: 0
Views: 194
Reputation: 59
Use maxDate to limit the selected date.
var options = $.extend(true, $scope.global.rangePickeOptions, {
startDate: moment(serverTime).startOf('day'),
endDate: moment(serverTime),
minDate:moment(serverTime).subtract(Number(data)-1, 'days'),
maxDate: moment(serverTime).format('YYYY-MM-DD'),
opens: "right"
})
Upvotes: 1