0

Previous month button should be hidden with ng-show="isPastMonth(calendarDate)" for past month form the current month.

Is there any option in the angular-bootstrap-calendar to hide decrement="calendarView" for past months ?

<button
  class="btn btn-primary"
  mwl-date-modifier
  date="vm.viewDate"
  decrement="vm.calendarView">
  Previous
</button>

Demo: http://plnkr.co/edit/LE4F4U7AnnD3tjM9ZH4G?p=preview

Mo.
  • 26,306
  • 36
  • 159
  • 225

1 Answers1

0

You can use

vm.previousMonth = angular.copy((vm.viewDate.getFullYear() * 12) + vm.viewDate.getMonth()) - 1;

//To get the previous month then to disable using this condition

ng-disabled="vm.previousMonth === ((vm.viewDate.getFullYear() * 12) + vm.viewDate.getMonth()) - 1"

Check it here http://plnkr.co/edit/NFI6tq?p=preview

Mina paulis
  • 392
  • 3
  • 14