Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Year/Month navigation in Angular UI Datepicker

I'm wondering if any knows how to disable the month/year navigation button on the Angular UI datepicker (http://angular-ui.github.io/bootstrap/#/datepicker).

We want to disable the ability for users to click on the "Month/Year" text in between the navigation arrows and can't figure it out.

enter image description here

Our current config options look like this:

$scope.dateOptions = {
        'year-format': "'yyyy'",
        'starting-day': 0,
        'show-weeks': false
    };

Our html looks like this:

<span datepicker-popup="shortDate" ng-model="currentDate" is-open="isDatePickerOpen" datepicker-options="dateOptions" show-button-bar="false" ng-click="openDatePicker($event)"></span>

Has anyone figured this out?

like image 835
nweg Avatar asked Dec 20 '22 06:12

nweg


1 Answers

You can use the max-mode property and set it to day and will disable that button.

<datepicker max-mode="day" ng-model="dt"></datepicker>

Have a look here: http://plnkr.co/edit/5I8QQiI3dLvOpyDjd2fk?p=preview

like image 86
Alex Stoicuta Avatar answered Dec 26 '22 19:12

Alex Stoicuta