Last active
January 1, 2020 19:01
-
-
Save itskhaledmohammad/8c696cd8712e9d03649cc0deb7c35199 to your computer and use it in GitHub Desktop.
Get Duration of a WesBos's Course.
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 mins = 0; | |
var sec = 0; | |
durations = Array.from(document.querySelectorAll('.duration')) | |
durations.forEach(e => { | |
mins += parseInt(e.textContent.split(":")[0]); | |
sec += parseInt(e.textContent.split(":")[1]); | |
}) | |
sec += (mins * 60) | |
new Date(sec * 1000).toISOString().substr(11, 8); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment