angular-ui / ui-calendar

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

Is it possible to have the calendar go back to the current month, without pressing the arrow button? #468

Open Hiroki111 opened 7 years ago

Hiroki111 commented 7 years ago

Let me illustrate the situation.

  1. The user goes back to the previous month by clicking the left arrow button.
  2. The user clicks one of the events in the calendar, which now displays the events in the previous month.
  3. $scope.alertDayOnClick is run

At this point of time, the calendar still displays events in the previous month. Is it possible to have the calendar go back to the current month, without pressing the arrow?

Any advice will be appreciated!

tomfrit commented 7 years ago

You can use uiCalendarConfig.calendars[calendar].fullCalendar('gotoDate',date); calendar being your calendar and date the Date object you want to display