ui-calendar icon indicating copy to clipboard operation
ui-calendar copied to clipboard

Set calendar current date

Open AlphaNerd opened this issue 8 years ago • 3 comments

How do you set the calendars current view date dynamically from controller. I want to be able to click a day in the month view and auto switch to that day in dayView.

AlphaNerd avatar Oct 19 '16 17:10 AlphaNerd

+1

mohamed-magdy avatar Nov 23 '16 18:11 mohamed-magdy

in the calendar ui config, attach the dayclick event: dayClick: $scope.alertOnDayClick

in the event handler, you can switch view, and jump to the date: $scope.alertOnDayClick = function (date, jsEvent, view, resource) { if (view.name !== 'month') return; uiCalendarConfig.calendars.myCalendar1.fullCalendar('changeView', 'agendaDay'); uiCalendarConfig.calendars.myCalendar1.fullCalendar('gotoDate', date ); }

myCalendar1 is the name of the calendar in the HTML: <div class="calendar" ng-model="eventSources" calendar="myCalendar1" ui-calendar="uiConfig.calendar"></div>

CurtisVayne avatar Dec 04 '16 18:12 CurtisVayne

Thanks Curtis Vayne. It works.

vilasdh1232 avatar Jan 05 '17 06:01 vilasdh1232