[eGroupWare-svn] r55786 - /trunk/calendar/js/et2_widget_planner_row.js

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: nathangray
Date: Wed Apr 20 17:40:09 2016
New Revision: 55786

URL: http://svn.stylite.de/viewvc/egroupware?rev=55786&view=rev
Log:
Use event sorting from daycol to keep event order within a row more consistent

Modified:
    trunk/calendar/js/et2_widget_planner_row.js

Modified: trunk/calendar/js/et2_widget_planner_row.js
URL: http://svn.stylite.de/viewvc/egroupware/trunk/calendar/js/et2_widget_planner_row.js?rev=55786&r1=55785&r2=55786&view=diff
==============================================================================
--- trunk/calendar/js/et2_widget_planner_row.js (original)
+++ trunk/calendar/js/et2_widget_planner_row.js Wed Apr 20 17:40:09 2016
@@ -309,6 +309,20 @@
 		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;
 		});
 


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.