Skip to content

Instantly share code, notes, and snippets.

@matrixik
Last active August 29, 2023 18:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matrixik/7bb0d7a290c66e6de29d183c4a38424d to your computer and use it in GitHub Desktop.
Save matrixik/7bb0d7a290c66e6de29d183c4a38424d to your computer and use it in GitHub Desktop.
[userscript] ISO Time on focus on github.com

ISO Time on focus on github.com

A userscript that allow you to see ISO date when you focus on dates on github.com

Install from gist.

// ==UserScript==
// @name ISO Time on focus on github.com
// @version 1.1
// @description A userscript that allow you to see ISO date when you focus on dates on github.com
// @author Dobrosław Żybort
// @namespace https://github.com/matrixik
// @match https://github.com/*
// @match https://gist.github.com/*
// @run-at document-end
// @grant none
// @downloadURL https://gist.github.com/matrixik/7bb0d7a290c66e6de29d183c4a38424d/raw/github-time.user.js
// ==/UserScript==
const rts = document.querySelectorAll("relative-time");
rts.forEach((rt) => {
// BUG: Replacing node is not working
// node = rt.cloneNode(true);
// node.setAttribute("format", "YYYY-MM-DD HH:mm:ss z");
// rt.replaceWith(node);
rt.title = rt.getAttribute("datetime");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment