angularjsfullcalendarangular-uiui-calendar

How do I set the default month for the angular-ui/ui-calendar for AngularJS(ver 1)? By default, it sets it to the current month


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 
    } 
};

Solution

  • Fixed the issue. I used the attribute 'defaultDate' instead of 'month'. This has been updated based on the fullcalendar docs here. It accepts any moment date. For example:

    $scope.uiConfig = {
    calendar:{
     defaultDate: "2018-10-01"
     }
    }