server/sports/sports-parsing.js
// Parses the information from a short result row (5 items) into a result dictionary.
Parses the information from a short result row (5 items) into a result dictionary.
Parses the information from a short result row ( 5 items ) into a result dictionary .
function parseShortResultRow(itemsInRow, schoolYears) {
    if (itemsInRow.length == 5) {
        var resultDictionary = {};
        var dateString = strip(itemsInRow[2].innerHTML);
        if (dateString) {
            resultDictionary['date'] = formattedDateString(dateString, null, schoolYears);
            resultDictionary['opponent_name'] = strip(itemsInRow[3].innerHTML); 
            resultDictionary['home_score'] = -1;
            resultDictionary['opponent_score'] = -1;
            return resultDictionary;
        } else {
            return null; 
        }
    } else {
        return null;
    }
}
function parseShortResultRow ( itemsInRow , schoolYears ) { if ( itemsInRow . length == 5 ) { var resultDictionary = { } ; var dateString = strip ( itemsInRow [ 2 ] . innerHTML ) ; if ( dateString ) { resultDictionary [ 'date' ] = formattedDateString ( dateString , null , schoolYears ) ; resultDictionary [ 'opponent_name' ] = strip ( itemsInRow [ 3 ] . innerHTML ) ; resultDictionary [ 'home_score' ] = - 1 ; resultDictionary [ 'opponent_score' ] = - 1 ; return resultDictionary ; } else { return null ; } } else { return null ; } }
Parses the information from a short result row (5 items) into a result dictionary.
Parses the information from a short result row ( 5 items ) into a result dictionary .
//name of event //date doesn't exist