mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
Use event sorting from daycol to keep event order within a row more consistent
This commit is contained in:
parent
02c7014a0a
commit
ea612aeb8e
@ -309,6 +309,20 @@ var et2_calendar_planner_row = (function(){ "use strict"; return et2_valueWidget
|
||||
this._children.sort(function(a,b) {
|
||||
var start = new Date(a.options.value.start) - new Date(b.options.value.start);
|
||||
var end = new Date(a.options.value.end) - new Date(b.options.value.end);
|
||||
// Whole day events sorted by ID, normal events by start / end time
|
||||
if(a.options.value.whole_day && b.options.value.whole_day)
|
||||
{
|
||||
// Longer duration comes first so we have nicer bars across the top
|
||||
var duration =
|
||||
(new Date(b.options.value.end) - new Date(b.options.value.start)) -
|
||||
(new Date(a.options.value.end) - new Date(a.options.value.start));
|
||||
|
||||
return duration ? duration : (a.options.value.app_id - b.options.value.app_id);
|
||||
}
|
||||
else if (a.options.value.whole_day || b.options.value.whole_day)
|
||||
{
|
||||
return a.options.value.whole_day ? -1 : 1;
|
||||
}
|
||||
return start ? start : end;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user