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

how to disable previous date in ui-calender #411

Closed naveencasp closed 7 years ago

peterver commented 8 years ago

care to elaborate which context you would like to disable previous days/ranges in :] ?

There are several possibilities for this, for example if you want to prevent people from adding events in the past, you can set a constraint object on your event ( or if you're using event sources, you can configure the event source for this )

http://fullcalendar.io/docs/event_ui/eventConstraint/

amulyadande commented 7 years ago

how can i disable the previous dates upto current date in ui-calendar ? can someone help me?

john-kellum-nant commented 7 years ago

Add the following line to your configuration: eventClick: $scope.eventClick

Then create a new function. $scope.eventClick = function (eventData, jsEvent, view) { // If it's in the present or future, run the click action. if (moment(eventData.startTime).diff(moment()) >= 0) { foo(eventData); } };

amulyadande commented 7 years ago

hi, i tried bt am not getting any response .can u tell me the exact file name where i hv to add that code