angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

Disable previous button on current month #325

Open nielvrom opened 8 years ago

nielvrom commented 8 years ago

Is it possible to disable the previous button when the current month is presented so they can't navigate to a month previous then this month?

I couldn't find it anywhere, can you help me?

golekunal88 commented 8 years ago

please add this to fullcalendar.js

function updatePrevButton() { var now = t.getNow(); if (now.isWithin(currentView.intervalStart, currentView.intervalEnd)) { header.disableButton('prev'); } else { header.enableButton('prev'); } }

&& call updatePrevButton(); with updateTodayButton();