Created
October 4, 2021 03:41
-
-
Save ubershmekel/f38eef7044396a2605c02b7e3213ed9d to your computer and use it in GitHub Desktop.
Paste this in the JS console when looking at github commit history
This file contains hidden or 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
dateEls = [...document.querySelectorAll('relative-time')] | |
dates = dateEls.map(it => new Date(it.attributes['datetime'].textContent)); | |
durations = []; | |
for (const [i, dt] of dates.entries()) { | |
const hours = Math.round((dates[i] - dates[i + 1]) / 3600e2) / 10; | |
const newNode = document.createTextNode("- took hours " + hours); | |
dateEls[i].parentNode.appendChild(newNode); | |
durations.push(hours) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment