我正在使用angular-ui bootstrap datepicker.现在我需要从datepicker中删除#(周)列和周按钮.这个日期选择器正在我的应用程序的许多形式中使用.我想从所有这些中删除周列.
为此,我在全局配置了datepickerConfig(show-weeks),但它仍无效.任何人都可以让我知道我做错了吗?
对于弹出窗口中的datepicker,datepicker-options属性具有值dateOptions,其中可以为任何datepicker设置添加json,如下面的HTML所示.
<input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" min-date="minDate" max-date="'2015-06-22'" **datepicker-options="dateOptions"** date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
在javascript中给出了这个
$scope.dateOptions = { formatYear: 'yy', startingDay: 1, };
只需在这样的dateOptions中添加showWeeks:false,
$scope.dateOptions = { formatYear: 'yy', startingDay: 1, showWeeks:'false' };
或者你可以添加像'show-weeks':'false'.演示在plunker上显示[ http://plnkr.co/edit/qbp3IObj13op2RS17IEg?p=preview] [1 ]
请看这个例子:http://plnkr.co/edit/6i4G7JkvBiWXZYlrV2GL?p=preview
angular.module('app', ['ui.bootstrap']) .config(function (datepickerConfig) { datepickerConfig.showWeeks = false; });