0

최신 AngularUI Bootstrap을 실행 중이며 버튼으로 클릭하여 열면 활성화되는 Datepicker가 있습니다.AngularUI Bootstrap Datepicker 최소 날짜 설정

클릭 한 날짜를 사용 중지하는 방법에 대한 답변을 얻으려고 시도했습니다. 2013 년 1 월 1 일부터 2012 년 12 월 31 일까지를 의미하며, 이전 버전은 선택할 수 없습니다. 다음은

는 속성이 그냥 min이 있었다 min-date 내 코드

AngularJS와

    $scope.today = function() { 
         $scope.dt = new Date(); 
        }; 
        $scope.today(); 

        $scope.clear = function() { 
         $scope.dt = null; 
        }; 
        // Disable weekend selection 
        $scope.disabled = function(date, mode) { 
         //return (mode === 'day' && (date.getDay() === 0 || date.getDay() === 6)); 
        }; 

        $scope.toggleMin = function() { 
         $scope.minDate = $scope.minDate ? null : new Date(); 
        }; 
        //$scope.toggleMin(); 

        $scope.open = function() { 
         $timeout(function() { 
          $scope.opened = true; 
          $scope.minEndDate = '2013-01-01'; 
         }); 
        }; 


        $scope.dateOptions = { 
         formatYear: 'yy', 
         startingDay: 1 
        }; 
        $scope.initDate = new Date('2016-15-20'); 
        $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate']; 
        $scope.format = $scope.formats[0]; 

HTML

<input type="text" class="form-control input--text" datepicker-popup="{{format}}" ng-model="newperson.dob" is-open="$parent.opened" min="minEndDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" /> 
        <button type="button" class="datepicker-btn" ng-click="open()"><i class="fa fa-calendar"></i></button> 
+0

안녕하세요 도널드, 저의 오래된 답변을 정리하고 있습니다. 도움이된다면 답장으로 표시하십시오. 그레시아. – acg

답변

0

입니다 :

<input type="text" class="form-control input--text" datepicker-popup="{{format}}" ng-model="newperson.dob" is-open="$parent.opened" min-date="minEndDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" /> 
        <button type="button" class="datepicker-btn" ng-click="open()"><i class="fa fa-calendar"></i></button> 
관련 문제