Skip to content

Instantly share code, notes, and snippets.

@bmidgley
Last active April 29, 2023 13:59
Show Gist options
  • Save bmidgley/5d626f62252cf169bbb896838b8e2ca7 to your computer and use it in GitHub Desktop.
Save bmidgley/5d626f62252cf169bbb896838b8e2ca7 to your computer and use it in GitHub Desktop.
create as a bookmarklet and run it to show real times on a github page -- why does github hide times??
javascript:(function() {
document.querySelectorAll("relative-time").forEach(function(el) {
var parent = el.parentNode;
var timestamp = el.title;
var span = document.createElement("span");
span.innerHTML = timestamp.replace(/20\d\d, /,"");
parent.removeChild(el);
parent.appendChild(span);
});
})();
@bmidgley
Copy link
Author

I had to remove the year because the time is too long to fit some fields

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment