弹出窗口中的 AngularUI 月份选择器显示为日期选择器 [英] AngularUI monthpicker in popup shown as datepicker
问题描述
我正在尝试在 monthpicker-mode 中使用 angular ui datepicker作为弹出窗口,但显示为日期选择器.
I'm trying to use the angular ui datepicker in monthpicker-mode as a popup, but it is shown as a datepicker.
我在这里找到了一个月份选择器的工作示例作为内联选择器,但是我需要它作为弹出窗口.
I've found a working example of the monthpicker as inline-picker here, but I need it as a popup.
这是我尝试过的内容,基于官方示例.
推荐答案
您的代码中存在一些语法问题.
There are some syntax problems in your code.
指令 max-mode 和 min-mode 将采用单引号覆盖的参数.所以正确的方法应该是,
the directives max-mode and min-mode will take parameters covered with a single quote. So the proper way should be,
<input type="text" show-weeks="false" show-button-bar="false" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="status.opened" min-date="minDate" max-date="maxDate" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" min-mode="'month'" max-mode="'month'" />
您可以从这里 并搜索 DatePicker,其中 min-mode 和 max-mode 的功能指令被解释.
You can checkout the docs of Angular Bootstrap from here and search for DatePicker where the functionalities of min-mode and max-mode directives are explained.
例如检查这个演示
[注意:虽然现在回答这个问题为时已晚,但您可能会发现它有帮助]
[Note : Though it's too late to answer this question, but you may find it helpful]
这篇关于弹出窗口中的 AngularUI 月份选择器显示为日期选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!