Created
April 17, 2020 18:41
-
-
Save byron70/42b3a1849468626f025439642b0cfa3d to your computer and use it in GitHub Desktop.
gitlab convert relative times to absolute
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
// ==UserScript== | |
// @name GitLab Local Time | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1.0 | |
// @description Show time instead of relative time in UI | |
// @author Byron Mann | |
// @match https://yourdomain.gitlab.domain.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function gitlabTime() { | |
const timeElementList = Array.from(document.getElementsByTagName('time')); | |
timeElementList.forEach(function(elem) { | |
console.log(elem.getAttribute('title')); | |
if (elem.getAttribute('title')) { | |
elem.innerHTML = elem.getAttribute('title'); | |
} | |
if (elem.getAttribute('data-original-title')) { | |
elem.innerHTML = elem.getAttribute('data-original-title'); | |
} | |
}); | |
setTimeout(() => { | |
gitlabTime(); | |
}, 2000) | |
} | |
setTimeout(() => { | |
gitlabTime(); | |
}, 1000) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment