raw/ace/assets/js/uncompressed/fullcalendar.js
function buildSegmentRows(segments) {
		var rowCnt = getRowCnt();
		var segmentRows = [];
		var segmentI;
		var segment;
		var rowI;

		// group segments by row
		for (segmentI=0; segmentI<segments.length; segmentI++) {
			segment = segments[segmentI];
			rowI = segment.row;
			if (segment.element) { // was rendered?
				if (segmentRows[rowI]) {
					// already other segments. append to array
					segmentRows[rowI].push(segment);
				}
				else {
					// first segment in row. create new array
					segmentRows[rowI] = [ segment ];
				}
			}
		}

		// sort each row
		for (rowI=0; rowI<rowCnt; rowI++) {
			segmentRows[rowI] = sortSegmentRow(
				segmentRows[rowI] || [] // guarantee an array, even if no segments
			);
		}

		return segmentRows;
	}
function buildSegmentRows(segments) {
		var rowCnt = getRowCnt();
		var segmentRows = [];
		var segmentI;
		var segment;
		var rowI;

		// group segments by row
		for (segmentI=0; segmentI<segments.length; segmentI++) {
			segment = segments[segmentI];
			rowI = segment.row;
			if (segment.element) { // was rendered?
				if (segmentRows[rowI]) {
					// already other segments. append to array
					segmentRows[rowI].push(segment);
				}
				else {
					// first segment in row. create new array
					segmentRows[rowI] = [ segment ];
				}
			}
		}

		// sort each row
		for (rowI=0; rowI<rowCnt; rowI++) {
			segmentRows[rowI] = sortSegmentRow(
				segmentRows[rowI] || [] // guarantee an array, even if no segments
			);
		}

		return segmentRows;
	}
function buildSegmentRows ( segments ) { var rowCnt = getRowCnt ( ) ; var segmentRows = [ ] ; var segmentI ; var segment ; var rowI ; // group segments by row for ( segmentI = 0 ; segmentI < segments . length ; segmentI ++ ) { segment = segments [ segmentI ] ; rowI = segment . row ; if ( segment . element ) { // was rendered? if ( segmentRows [ rowI ] ) { // already other segments. append to array segmentRows [ rowI ] . push ( segment ) ; } else { // first segment in row. create new array segmentRows [ rowI ] = [ segment ] ; } } } // sort each row for ( rowI = 0 ; rowI < rowCnt ; rowI ++ ) { segmentRows [ rowI ] = sortSegmentRow ( segmentRows [ rowI ] || [ ] // guarantee an array, even if no segments ) ; } return segmentRows ; }
Build an array of segment arrays, each representing the segments that will be in a row of the grid, sorted by which event should be closest to the top.
Build an array of segment arrays each representing the segments that will be in a row of the grid sorted by which event should be closest to the top .