Angular UI month picker Angular UI month picker angularjs angularjs

Angular UI month picker


For those people who are facing this issue, I have tried a lot of things and here is the simplest method that I found:

<input type="text" class="form-control" datepicker-popup="MM/yyyy" ng-model="dt" is-open="opened" datepicker-options="{minMode: 'month'}" datepicker-mode="'month'"/><span class="input-group-btn">    <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button></span>

The trick is that you must put datepicker-options="{minMode: 'month'}" datepicker-mode="'month'" into the input tag. This worked fine for me.


Just write these lines:

HTML

 <datepicker ng-model="date" min-mode="month" datepicker-mode="'month'"></datepicker>

JS

$scope.date = new Date();

**Don't forget to include necessary js/css files from http://angular-ui.github.io/bootstrap/

These above code worked for me. :) I know Its too late, but it may help some one.


I fixed this by updating from ui-bootstrap 0.13.0 to 0.13.1. This is my markup:

<input type="text" ng-model="DOB" datepicker-popup="MM-dd-yyyy" datepicker-mode="'year'" is-open="dobOpen" ng-click="dobOpen = true" />