mrchimp / tock

Timer Object/Class. Kickass!
MIT License
237 stars 33 forks source link

msToTime with Hours #31

Closed Brotakuu closed 8 years ago

Brotakuu commented 9 years ago

Having some trouble getting msToTime to display with hours (ie: "02:00:00")

var timer = new Tock({
        callback: function() {
            resultElement.text(timer.msToTime(timer.lap("{hh}:{mm}:{ss}.{ll}")));
            if (start_time && timer.lap() - start_time > run_for) {
                resultElement.text(resultElement.text() + ' Stopped at ' + timer.msToTime(timer.lap()));
                 timer.stop();
            }
        }
  });

Still outputs just minutes and seconds.

Brotakuu commented 9 years ago

Actually, looks like msToTimecode is the correct function to call for hours:minutes:seconds.

mrchimp commented 9 years ago

Yeah, that's what you want. I should probably improve the docs and put them next to each other...