Angular UI month picker

后端 未结 7 2297
日久生厌
日久生厌 2020-12-15 18:34

I am trying to use angular-ui-datepicker as a month picker. But not able to configure it, tried it all. Here is the PLUNKER.

I tried to set the modes as



        
相关标签:
7条回答
  • 2020-12-15 19:23

    I couldn't get this to work as a month picker either, spent hours trying different options. Wish I checked the source code earlier - turns out the input type is key.

    To change it to month picker mode, change the input type to "month". This works for both pop-up and in-line variants.

    Following from the example on https://angular-ui.github.io/bootstrap/ you could do this:

    <input type="month" class="form-control" datepicker-popup ng-model="dt" is-open="status.opened" min-date="minDate" max-date="maxDate" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
    
    <span class="input-group-btn">
        <button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
    </span>
    
    0 讨论(0)
提交回复
热议问题