Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
476 B
0
Indexable
Never
$(".events-table thead th").first().after("<th colspan='1' class='ui-state-default sorting_disabled'>Diff</th>");

var last = false;

$(".main-table-number").each(function() {
    if (!last) {
        $(this).after("<td>-</td>");
        last = moment($(this).text(), "mm:ss.SSS");
    } else {
        var current = moment($(this).text(), "mm:ss.SSS");
        $(this).after("<td style='width:2em'>" + (current.diff(last) / 1000) + "</td>");
        last = current;
    }
});