js/utils.js
// Return a time in hours and minutes
Return a time in hours and minutes
Return a time in hours and minutes
function nice_length(mylength, rx_hr, rx_hrs, rx_min, rx_mins) {
        var mins  = Math.round((mylength % 3600) / 60);
        var hours = Math.round(mylength / 3600);
        var ret;
        if (hours) {
            if (hours > 1)
                ret = rx_hrs.replace(/\$1/, hours);
            else
                ret = rx_hr.replace(/\$1/, hours);
        }
        else
            ret = '';
        if (mins > 0) {
            if (ret.length)
                ret = ret + ' ';
            if (mins > 1)
                ret = ret + rx_mins.replace(/\$1/, mins);
            else
                ret = ret + rx_min.replace(/\$1/, mins);
        }
        return ret;
    }
function nice_length ( mylength , rx_hr , rx_hrs , rx_min , rx_mins ) { var mins = Math . round ( ( mylength % 3600 ) / 60 ) ; var hours = Math . round ( mylength / 3600 ) ; var ret ; if ( hours ) { if ( hours > 1 ) ret = rx_hrs . replace ( / \$1 / , hours ) ; else ret = rx_hr . replace ( / \$1 / , hours ) ; } else ret = '' ; if ( mins > 0 ) { if ( ret . length ) ret = ret + ' ' ; if ( mins > 1 ) ret = ret + rx_mins . replace ( / \$1 / , mins ) ; else ret = ret + rx_min . replace ( / \$1 / , mins ) ; } return ret ; }
Return a time in hours and minutes
Return a time in hours and minutes