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

Commit af34eb2

Browse files
committed
Fix eventFingerPrint when start/end are strings
Based on #281
1 parent f0ab8e1 commit af34eb2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/calendar.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ angular.module('ui.calendar', [])
4040
if (!e._id) {
4141
e._id = eventSerialId++;
4242
}
43+
44+
var extraSignature = extraEventSignature({event: e}) || '';
45+
var start = moment.isMoment(e.start) ? e.start.unix() : (e.start ? moment(e.start).unix() : '');
46+
var end = moment.isMoment(e.end) ? e.end.unix() : (e.end ? moment(e.end).unix() : '');
47+
4348
// This extracts all the information we need from the event. http://jsperf.com/angular-calendar-events-fingerprint/3
44-
return "" + e._id + (e.id || '') + (e.title || '') + (e.url || '') + (+e.start || '') + (+e.end || '') +
45-
(e.allDay || '') + (e.className || '') + extraEventSignature({event: e}) || '';
49+
return "" + e._id + (e.id || '') + (e.title || '') + (e.url || '') + start + end +
50+
(e.allDay || '') + (e.className || '') + extraSignature;
4651
};
4752

4853
var sourceSerialId = 1, sourceEventsSerialId = 1;

0 commit comments

Comments
 (0)