2016-05-05 4 views
0

AngularJSのdatepicker(ui.bootstrap.datepicker)は、指定された月の6週間のカレンダーで表示されます。AngularJSの5週間datepicker

AngularJS <code>6</code> week datepicker

どのように我々はそれがデフォルトで月の日付ピッカーあたり5週間に変更し、必要な場合にのみ6週間の行を使用できますか?

<input type="text" class="form-control datedesktop" 
      uib-datepicker-popup="{{format}}" 
      ng-model="dt" 
      is-open="popup1.opened" 
      datepicker-options="dateOptions" 
      ng-required="true" 
      show-button-bar="true" 
      show-weeks="false" 
      alt-input-formats="altInputFormats" 
      on-open-focus="false" 
      close-text="X" 
      clear-text="" 
      ng-click="open()" /> 
     <span class="input-group-btn"> 
      <button type="button" class="btn btn-default btn-calendar" ng-click="open()"> 
       <i class="glyphicon glyphicon-calendar"></i> 
      </button> 
     </span> 
+1

いくつかのコード例を共有してください。 – Mostafiz

+0

はdatepicker月テンプレートを上書きします。githubソースリポジトリで見つけることができます – svarog

答えて

0

@svarogが上書きされているようにテンプレートは最適なアプローチです。

5週間に変更するオプションはありません。

あなたはdatepicker library(行番号399)

// 42 is the number of days on a six-week calendar 
    var days = this.getDates(firstDate, 42); 

は、No.of週42(* 6週7日)を参照してください場合はハードコードされています。 42を35で置き換えた場合(5週間* 7行)、これは5週間のカレンダーを提供します。

関連する問題