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

Commit 7c10dc4

Browse files
committed
feat(v2): Fix binding on change title (on a source event)
1 parent 8560e92 commit 7c10dc4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/calendar.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ angular.module('ui.calendar', [])
3737
};
3838

3939
this.eventsFingerprint = function(e) {
40-
if (!e.__uiCalId) {
41-
e.__uiCalId = eventSerialId++;
40+
if (!e._id) {
41+
e._id = eventSerialId++;
4242
}
4343
// This extracts all the information we need from the event. http://jsperf.com/angular-calendar-events-fingerprint/3
44-
return "" + e.__uiCalId + (e.id || '') + (e.title || '') + (e.url || '') + (+e.start || '') + (+e.end || '') +
44+
return "" + e._id + (e.id || '') + (e.title || '') + (e.url || '') + (+e.start || '') + (+e.end || '') +
4545
(e.allDay || '') + (e.className || '') + extraEventSignature(e) || '';
4646
};
4747

@@ -246,11 +246,13 @@ angular.module('ui.calendar', [])
246246

247247
eventsWatcher.onRemoved = function(event) {
248248
scope.calendar.fullCalendar('removeEvents', function(e) {
249-
return e.__uiCalId === event.__uiCalId;
249+
return e._id === event._id;
250250
});
251251
};
252252

253253
eventsWatcher.onChanged = function(event) {
254+
event._start = $.fullCalendar.moment(event.start);
255+
event._end = $.fullCalendar.moment(event.end);
254256
scope.calendar.fullCalendar('updateEvent', event);
255257
};
256258

0 commit comments

Comments
 (0)