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

Ui calendar #376

Closed Jack113 closed 8 years ago

Jack113 commented 8 years ago

How can I browse to certain date ? for example i have a button that shows data last year today, if i click on it the calendar must go back one year

flick36 commented 8 years ago

the ng-click of the button or however you are managing the click have to call a function in a controller where you inject the uiCalendarConfig and then just use it like:

uiCalendarConfig.calendars.mycalendar.fullCalendar( 'gotoDate', date )

where date can be a Moment object, or anything the Moment constructor accepts.

http://fullcalendar.io/docs/current_date/gotoDate/