Who knows where to get the javascript function, which converts the specified number of seconds to the format:

HH hour (s) MM minutes (s) SS seconds (s)

    1 answer 1

    function timeRus(amount,timename){ var problem_of_teen = amount%100; if(timename=='секунды'){ var base='секунд'; var endings = new Array('','','а','ы'); } if(timename=='минуты'){ var base='минут'; var endings = new Array('','','а','ы'); } if(timename=='часы'){ var base='час'; var endings = new Array('ов','ов','','а'); } if(problem_of_teen >= 11 && problem_of_teen <= 19){ return amount+" "+base+endings[0]; } problem_of_numerals = amount%10; if(problem_of_numerals==0 || (problem_of_numerals>=5 && problem_of_numerals<=9)){ return amount+" "+base+endings[1]; } if(problem_of_numerals==1){ return amount+" "+base+endings[2]; } if(problem_of_numerals>=2 && problem_of_numerals<=4){ return amount+" "+base+endings[3]; } } 

    USAGE:

     timeRus(12,'часы')+timeRus(48,'минуты')+timeRus(40,'секунды'); 
    • Cool! Thank! - weekens
    • remove current dollars: reworked from PHP :) - knes