Last active
December 6, 2018 15:04
-
-
Save eviltester/dd242b5fed697cf3fe91a86a25fd5ab9 to your computer and use it in GitHub Desktop.
How long is a course on zenler?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var times = document.getElementsByClassName("curr-time"); | |
var totaltime= 0; | |
for (var i = 0, len = times.length; i < len; i++) { | |
time = document.getElementsByClassName("curr-time")[i].innerText.trim(); | |
if(time.length>0){ | |
var b = time.split(':'); | |
console.log(b); | |
seconds = (Number(b[0])*60) + (Number(b[1])); | |
totaltime+=seconds; | |
} | |
} | |
console.log(" - " + totaltime + " seconds : " + totaltime / (60*60) + " hours" ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on code found here https://stackoverflow.com/questions/25764553/add-2-times-together-javascript