Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Fix issue with event rendering #353

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

angular.module('ui.calendar', [])
.constant('uiCalendarConfig', {calendars: {}})
.controller('uiCalendarCtrl', ['$scope',
.controller('uiCalendarCtrl', ['$scope',
'$locale', function(
$scope,
$scope,
$locale){

var sources = $scope.eventSources,
Expand Down Expand Up @@ -40,11 +40,11 @@ angular.module('ui.calendar', [])
if (!e._id) {
e._id = eventSerialId++;
}

var extraSignature = extraEventSignature({event: e}) || '';
var start = moment.isMoment(e.start) ? e.start.unix() : (e.start ? moment(e.start).unix() : '');
var end = moment.isMoment(e.end) ? e.end.unix() : (e.end ? moment(e.end).unix() : '');

// This extracts all the information we need from the event. http://jsperf.com/angular-calendar-events-fingerprint/3
return "" + e._id + (e.id || '') + (e.title || '') + (e.url || '') + start + end +
(e.allDay || '') + (e.className || '') + extraSignature;
Expand Down Expand Up @@ -265,7 +265,7 @@ angular.module('ui.calendar', [])
calendar.fullCalendar(options);
if(attrs.calendar) {
uiCalendarConfig.calendars[attrs.calendar] = calendar;
}
}
};
scope.$on('$destroy', function() {
scope.destroyCalendar();
Expand Down Expand Up @@ -299,7 +299,7 @@ angular.module('ui.calendar', [])

eventsWatcher.onAdded = function(event) {
if (calendar && calendar.fullCalendar) {
calendar.fullCalendar('renderEvent', event, (event.stick ? true : false));
calendar.fullCalendar('renderEvent', event, true);
}
};

Expand Down