Angular UI Bootstrap Datepicker中有一个选项可以显示多个月吗?比如JQuery datepicker中的numberOfMonths
选项。
答案 0 :(得分:1)
使用2个不同型号的日期选择器:
<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);
});