I am currently utilizing the ui-bootstrap directive for a datepicker. My goal is to restrict the selection of dates to today's date or any future dates. Below is the HTML code snippet for the datepicker:
<div class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="yyyy-MM-dd"
name="start_date"
ng-model="loan.start_date"
is-open="popup1.opened"
datepicker-options="dateOptions"
ng-required="true"
close-text="Close"
alt-input-formats="altInputFormats"
/>
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open1()"><i class="glyphicon glyphicon-calendar"></i></button>
The corresponding JavaScript implementation is as follows:
$scope.inlineOptions = {
customClass: getDayClass,
minDate: new Date(),
showWeeks: true
};
$scope.dateOptions = {
dateDisabled: disabled,
formatYear: 'yy',
maxDate: new Date("2020-04-1"),
minDate: new Date() ,
startingDay: 1
};
If you have any insights on how I can achieve this, I would greatly appreciate your assistance. Thank you.