2016-03-29 6 views
0

私はuiブートストラップ指令ui-datepickerを使用しています。私は、今日の日付または将来の日付のみを選択できる日付ピッカーを設定します。ここでの日付ピッカーのHTMLは次のとおりです。ここでAngularjs uiブートストラップを使用して、今日の日付または将来の日付のみを選択できるようにします。

<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> 

は、私はjavascriptの側に持っているものです。

$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 
}; 

は、どのように私は事前のおかげで、これを達成することについて行くことができます。

+0

「無効」とは何ですか? –

答えて

0

あなたのjavascriptはOKですが、あなたのマークアップはちょっとしたものです。このplunker(Angularオリジナルから変更)をご覧ください。これは実際の例です。

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


    <p class="input-group"> 
      <input type="text" class="form-control" uib-datepicker-popup ng-model="dt" is-open="popup2.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close" /> 
      <span class="input-group-btn"> 
      <button type="button" class="btn btn-default" ng-click="open2()"><i class="glyphicon glyphicon-calendar"></i></button> 
      </span> 
     </p> 
+0

ありがとう、私は今働いている。 – newbieDev

関連する問題