I'm trying to integrate UI-calendar into my AngularJs and I managed to display the calendar with all of the events displayed in it.
The eventClick event is working fine, but when I try to add the dayClick event it is doing nothing.
Here is the part of my controller with the setup of the events and the uiConfig object.
$scope.alertOnDayClick = function(date, allDay, jsEvent, view) {
alert('Clicked on: ' + date.format());
}
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.events = [
{title: 'All Day Event',start: new Date(y, m, 1)},
{title: 'Long Event',start: new Date(y, m, d - 5),end: new Date(y, m, d - 2)},
{id: 999,title: 'Repeating Event',start: new Date(y, m, d - 3, 16, 0),allDay: false},
{id: 999,title: 'Repeating Event',start: new Date(y, m, d + 4, 16, 0),allDay: false},
{title: 'Birthday Party',start: new Date(y, m, d + 1, 19, 0),end: new Date(y, m, d + 1, 22, 30),allDay: false}
];
$scope.uiConfig = {
calendar:{
header:{
left: 'title',
center: '',
right: 'today prev,next'
},
lang:'nl',
eventClick: $scope.alertOnEventClick,
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnResize,
eventRender: $scope.eventRender,
dayClick: $scope.alertOnDayClick,
select: $scope.alertOnDayClick
}
};
In my view I have the following div to display the calendar in
"div class="calendar" calendar="myCalendar" ui-calendar="uiConfig.calendar" ng-model="eventSources"
Display is working eventClick is working but dayClick is not...
It is not giving me any errors or warnings. It just isn't working. Does anybody have any idea on why this is?
Any help is much appreciated