After pushing events loaded from the server, I am encountering an issue where they are not being displayed on the calendar. Interestingly, the events are in the correct format and can be seen when printed on the page, but for some reason, they do not show up on the calendar...
Here's a snippet of my code:
dashboardCtrl.controller('CalendarioCtrl', ['$scope', '$log', '$compile', 'uiCalendarConfig', 'SedutaGiuntaSrvc', 'ProgressivoSrvc', function ($scope, $log, $compile, uiCalendarConfig, SedutaGiuntaSrvc, ProgressivoSrvc) {
$scope.events = [];
/* Fetching meetings */
var loadSedutePerCalendario = function () {
SedutaGiuntaSrvc.getSeduteCalendario().then(function (response) {
if ('item' in response.data.response.result.items) {
var sedute = convertToArray(response.data.response.result.items.item);
angular.forEach(sedute, function (s, index) {
if (index < sedute.length) {
var date = new Date(s.data);
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$scope.events.push({id: s.id, title: s.progressivo + '_' + y, start: new Date(y, m, d+1)});
}
});
}
});
};
loadSedutePerCalendario();
$scope.eventSources = [$scope.events];
// Various event functions...
where could the problem lie?
This is the content of eventSources as printed on the page:
[{"id":1,"title":"1/2014","start":"2014-10-06T22:00:00.000Z","_id":1}]
I've looked into similar issues like the one discussed in this post on Stack Overflow, but unfortunately, it hasn't resolved my problem.