Skip to content

Instantly share code, notes, and snippets.

View ltrebing's full-sized avatar

Lars Trebing ltrebing

  • Vanilla Reply
  • Munich, Germany
View GitHub Profile
@ltrebing
ltrebing / Display commit timestamp at github as javascript bookmark
Last active May 30, 2017 15:23 — forked from PhilippGrulich/Display commit timestamp at github as javascript bookmark
This simple js bookmark let you display the correct commit timestamp at github
javascript:(function() {
var relativeTimeElements = window.document.querySelectorAll("relative-time, time-ago, time.js-timeago");
function pad(n) {
return n < 10 ? '0' + n : n;
}
relativeTimeElements.forEach(function(timeElement) {
var d = new Date(timeElement.attributes.datetime.value);
timeElement.innerHTML =
d.getFullYear() + '-' +
pad(d.getMonth()) + '-' +