Your request will need to directly patch the fullcalendar code.
This is mandatory because fullcalendar doesn't expose this function to the outside world.
I did check my response with version 1.4.11, but looking at the 1.5 branch on github shows that it should be the same.
The function to be patched is segCmp
, (found in src/util.js
for the source version, or simply near the end of the file in fullcalendar.js)
The original version is:
function segCmp(a, b) {
return (b.msLength - a.msLength) * 100 + (a.event.start - b.event.start);
}
The patched version should look like that:
function segCmp(a, b) {
var activeDiff = ((b.event.IsActive || false) - (a.event.IsActive || false));
if (activeDiff != 0) return activeDiff;
return (b.msLength - a.msLength) * 100 + (a.event.start - b.event.start);
}
I simply check wether the events have a different IsActive state and return the diff, if no diff the previous algorithm is preserved. (Note the b - a diff because you want IsActive:true BEFORE IsActive:false)
Note that segCmp
is called when splitting/ordering events and thus will apply in all views.
Best Regards,
Pascal
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…