如何隐藏过去一个月的减量按钮?

时间:2017-08-13 15:26:14

标签: javascript angularjs twitter-bootstrap calendar angular-bootstrap-calendar

上个月按钮应隐藏在当月的过去一个月ng-show="isPastMonth(calendarDate)"

angular-bootstrap-calendar 中是否有选项隐藏decrement="calendarView"过去几个月?

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

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

1 个答案:

答案 0 :(得分:0)

您可以使用

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"

在这里查看 http://plnkr.co/edit/NFI6tq?p=preview