在ui引导angularjs中是否有类似于结束日期的开始日期

在ui引导angularjs中是否有类似于结束日期的开始日期,angularjs,angular-ui-bootstrap,Angularjs,Angular Ui Bootstrap,我想禁用日期之前的日期。 有办法吗?这是我的密码 $scope.open = function($event) { $event.preventDefault(); $event.stopPropagation(); $scope.opened = true; }; $scope.dateOptions = { formatYear: 'yy', startingDay: 1 }; $scope.disabled = function(date, mode) { return ( mo

我想禁用日期之前的日期。 有办法吗?这是我的密码

$scope.open = function($event)
{
 $event.preventDefault();
 $event.stopPropagation();
 $scope.opened = true;
};
$scope.dateOptions = {
 formatYear: 'yy',
 startingDay: 1
};
$scope.disabled = function(date, mode) {
return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 6 ) );
};
HTML


如中所述:

  • 最小日期(默认为空):定义最小可用日期

  • 最大日期(默认为空):定义最大可用日期

这将使您的代码看起来像:

$scope.dateOptions = {
 formatYear: 'yy',
 startingDay: 1,
 minDate : new Date("whatever"),
 maxDate : new Date("whatever")
};
$scope.dateOptions = {
 formatYear: 'yy',
 startingDay: 1,
 minDate : new Date("whatever"),
 maxDate : new Date("whatever")
};