2016-04-22 50 views

回答

1

首先,你需要添加datepicker-popup-template-url財產

<input type="text" uib-datepicker-popup="MM/dd/yyyy" **datepicker-popup-template-url**="path/to/template.html" /> 

然後,你需要創建一個template.html

我添加了一個自定義按鈕,它是設置日期31/12/9999。模板低於

<ul class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" style="left: 0px; top: 43px; display: block;" ng-style="{top: position.top+'px', left: position.left+'px'}" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()"> 
    <li ng-transclude></li> 
    <li ng-if="showButtonBar" class="uib-button-bar"> 
    <span class="btn-group pull-left"> 
     <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select('today', $event)" ng-disabled="isDisabled('today')">{{ getText('current') }}</button> 
     <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select('31/12/9999', $event)">31/12/9999</button> 
    </span> 
    <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText('close') }}</button> 
    </li> 
</ul>