src/js/utils.js
branchpopcorn-port
changeset 553 10d08f43c534
parent 502 0b3523c65578
child 575 8f483e430f51
equal deleted inserted replaced
552:3e8be3e6bdfb 553:10d08f43c534
    36     return "0" + num.toString();
    36     return "0" + num.toString();
    37   } else {
    37   } else {
    38     return num.toString();
    38     return num.toString();
    39   }
    39   }
    40 };
    40 };
       
    41 
       
    42 /* convert a number of milliseconds to a tuple of the form 
       
    43    [hours, minutes, seconds]
       
    44 */
       
    45 IriSP.msToTime = function(ms) {
       
    46   return IriSP.secondsToTime(ms / 1000);
       
    47 }
    41 /* convert a number of seconds to a tuple of the form 
    48 /* convert a number of seconds to a tuple of the form 
    42    [hours, minutes, seconds]
    49    [hours, minutes, seconds]
    43 */
    50 */
    44 IriSP.secondsToTime = function(secs) {  
    51 IriSP.secondsToTime = function(secs) {  
    45   var hours = Math.abs(parseInt( secs / 3600 ) % 24);
    52   var hours = Math.abs(parseInt( secs / 3600 ) % 24);