角UI月份选择器选择器、UI

由网友(〆.黑色指甲油的妖染mm)分享简介:我将尝试使用角UI的日期选择器在一个月选择器...但不可以配置它,尝试了这一切......这里是 PLUNKER ... i am trying to use angular-ui-datepicker as a month picker... but not able to configure it, tried...

我将尝试使用角UI的日期选择器在一个月选择器...但不可以配置它,尝试了这一切......这里是 PLUNKER ...

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...

我试图设置模式为

          <input type="text" class="form-control col-md-3" 
          datepicker-popup="MMM-yyyy" min-mode="'month'" datepicker-mode="'month'"
          ng-model="dt" is-open="opened" close-on-date-selection="true"
          datepicker-options="dateOptions" date-disabled="disabled(date, mode)" 
          show-button-bar="false" show-weeks="false"/>
          <span class="input-group-btn">
            <button class="btn btn-default" ng-click="open($event)">
              <i class="glyphicon glyphicon-calendar"></i>
            </button>
          </span>

,也可作为的一部分:日期选择器的选项,使用JS为

and also as part of: datepicker-options, using js as

  $scope.dateOptions = {
    'year-format': "'yy'",
    'starting-day': 1,
    'datepicker-mode':"'month'",
    'min-mode':"month"   };

但也不能正常工作......请帮助

but that also is not working... please help

推荐答案

有关谁是面临这个问题的人,我已经尝试了很多东西,这里是我发现最简单的方法:

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>

诀窍在于,你必须把日期选择器选项={minMode:'月'}日期选择器模式=月输入标记。这对我来说工作得很好。

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

阅读全文

相关推荐

最新文章