When two events are on at exactly the same time, sort the first to be created earlier in the list (helps keep order, and makes tests simpler)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30181 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-09-02 11:46:48 +00:00
parent 248f8b47af
commit a1ce9d37f0
3 changed files with 8 additions and 1 deletions

View File

@@ -255,9 +255,11 @@ public class CalendarServiceImpl implements CalendarService
}
// Build our sorting, by date
// Sort by start date, then end date, then created at for two events with matching times
List<Pair<QName,Boolean>> sort = new ArrayList<Pair<QName, Boolean>>();
sort.add(new Pair<QName, Boolean>(CalendarModel.PROP_FROM_DATE, true));
sort.add(new Pair<QName, Boolean>(CalendarModel.PROP_TO_DATE, true));
sort.add(new Pair<QName, Boolean>(ContentModel.PROP_CREATED, true));
// We only want calendar entries
Set<QName> types = new HashSet<QName>();