多个月显示角度bootstrap datepicker

时间:2014-08-14 16:11:32

标签: angular-ui angular-ui-bootstrap

Angular UI Bootstrap Datepicker中有一个选项可以显示多个月吗?比如JQuery datepicker中的numberOfMonths选项。

1 个答案:

答案 0 :(得分:1)

使用2个不同型号的日期选择器:

Here is a plunker:

<body ng-controller="MainCtrl as main">

<div ng-form class="btn-group" dropdown>

    <datepicker ng-model="main.startDate" max-date="main.endDate"></datepicker>
    <datepicker ng-model="main.endDate" min-date="main.startDate"></datepicker>

</div>
<p>{{main.startDate | date:'EEEE MMMM d'}} - {{main.endDate | date:'EEEE MMMM d'}}</p>

var app = angular.module('plunker', ['ui.bootstrap']);

app.controller('MainCtrl', function($scope) {
  this.startDate = new Date();
  this.endDate = new Date(this.startDate.getTime() + 7 * 24 * 60 * 60 * 1000);
});