enarax / Flyteam Groundschool Total Time Calculator

// ==UserScript==
// @name        Flyteam Groundschool Total Time Calculator
// @namespace   marcelltoth
// @include     http://groundschool.flyteam.hu/self-tracker
// @version     1
// @grant       none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// ==/UserScript==



$(".views-table").each(function(index){ 
  var total = 0;
  $(this).find("tr").each(function(index){
    if(index==0){return;}
    let text = $(this).find("td").last().text().trim();
    console.log(text);
    total += parseFloat(text.substr(0, text.indexOf(' ')));
  })
  $(this).find("caption").append("<span> (Total: "+total+" hours)</span>")
})