Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multiple months display for angular bootstrap datepicker

Is there an option in Angular UI Bootstrap Datepicker to display multiple months? like numberOfMonths option in JQuery datepicker.

like image 490
dr.calix Avatar asked Nov 10 '22 03:11

dr.calix


1 Answers

Use 2 datepickers with different models:

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);
});
like image 112
alexoviedo999 Avatar answered Jan 04 '23 03:01

alexoviedo999