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 do I set the default month for the calendar? By default, it sets it to the current month. #537

Closed esjayrockz closed 5 years ago

esjayrockz commented 5 years ago

After having read the fullcalendar docs, I thought setting a month attribute in calendar in $scope.uiConfig as below would do it. But I can't understand where exactly I set the month attribute in.

$scope.uiConfig = { calendar:{ firstDay:1, month: 0, year: 2018, height: 220, aspectRatio: 1.09, editable: true, header:{ left: 'title', center: '', right: '' }, eventClick: $scope.alertOnEventClick, eventDrop: $scope.alertOnDrop, eventResize: $scope.alertOnResize, eventRender: $scope.eventRender, month: 3 } };

esjayrockz commented 5 years ago

Fixed the issue. I used the attribute 'defaultDate' instead of 'month'. This has been updated based on the fullcalendar docs here. For example: $scope.uiConfig = { calendar:{ defaultDate: "2018-10-01" } }