0

i have a table with element with same class, the cell of table contain time (es: 02:00 or 13:00), how i can this in javascript?

I try with this code:

var total = 0;

$('#table_format tr .tempo').each(function() {
  total += parseInt($(this).text());
});

$('#output').append("<div class='sum'>Totale ore: <span> " + total + "</span></div>");

but the sum does not happen correctly, for example 01:00 + 02:30 as a result is 3 and not 03:30.

Chuy
  • 1
  • 3

0 Answers0