Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS的5周日期选择器_Angularjs_Datepicker_Angular Ui Bootstrap - Fatal编程技术网

AngularJS的5周日期选择器

AngularJS的5周日期选择器,angularjs,datepicker,angular-ui-bootstrap,Angularjs,Datepicker,Angular Ui Bootstrap,AngularJS中的datepicker(ui.bootstrap.datepicker)显示了指定月份的6周日历 默认情况下,我们如何将其更改为每月5weeks日期选择器,并且仅在必要时使用6周行 <input type="text" class="form-control datedesktop" uib-datepicker-popup="{{format}}" ng-model="dt" is-op

AngularJS中的datepicker(
ui.bootstrap.datepicker
)显示了指定月份的6周日历

默认情况下,我们如何将其更改为每月
5
weeks日期选择器,并且仅在必要时使用6周行

    <input type="text" class="form-control datedesktop"
            uib-datepicker-popup="{{format}}"
            ng-model="dt"
            is-open="popup1.opened"
            datepicker-options="dateOptions"
            ng-required="true"
            show-button-bar="true"
            show-weeks="false"
            alt-input-formats="altInputFormats"
            on-open-focus="false"
            close-text="X"
            clear-text=""
            ng-click="open()" />
        <span class="input-group-btn">
            <button type="button" class="btn btn-default btn-calendar" ng-click="open()">
                <i class="glyphicon glyphicon-calendar"></i>
            </button>
        </span>

正如@svarog提到的,覆盖模板是最好的方法

没有选择改为5周

如果您看到(第399行)


第42周(6周*7天)的编号为硬编码。如果您将42替换为35,(5周*7行),这将为您提供5周的日历

当不得不隐藏不属于当前月份的行时,会遇到类似的问题。也许我的解决方案对某些人有用。UI引导版本2.5.0

覆盖了uib/template/datepicker/day.html模板

"<tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\" role=\"row\">\n"
“\n”
改为

"<tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\" role=\"row\" ng-hide=\"row[0].secondary && row[6].secondary\">\n"
“\n”

第[0]行。第二行和第[6]行。第二行
条件检查一周中的第一天和最后一天是否不属于当前月份

请分享一些您尝试过的代码示例。如果使用datepicker月模板,您可以在github源repo中找到它
"<tr class=\"uib-weeks\" ng-repeat=\"row in rows track by $index\" role=\"row\" ng-hide=\"row[0].secondary && row[6].secondary\">\n"