code: function compareSlotSegs(seg1, seg2) {
  	return seg1.start - seg2.start || // earlier start time goes first
  		(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first
  		(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title
  }
docs: A cmp function for determining which segment should be closer to the initial edge (the left edge on a left-to-right calendar).