See “real” commit date in github (hour/day)

后端 未结 7 1393
离开以前
离开以前 2021-01-31 00:36

Is there a way to see the date of a commit in github, with day/hour precision? Older commits appear in a \"human readable\" format, such as \"2 years ago\" instead of showing th

7条回答
  •  醉话见心
    2021-01-31 01:38

    I tried @odony's TamperMonkey/Greasemonkey script on Chrome but couldn't get it to work. detachCallback() wasn't recognized. So instead of detaching any callbacks, I simply replaced the node.

    // ==UserScript==
    // @name         Github: always show absolute times
    // @match        https://github.com/*
    // ==/UserScript==
    
    (function() {
        document.querySelectorAll("relative-time").forEach(function(el) {
            var parent = el.parentNode;
            var timestamp = el.title;
            var span = document.createElement("span");
            span.innerHTML = timestamp;
            parent.removeChild(el);
            parent.appendChild(span);
        });
    })();
    

    Sorry I haven't tested this with other browser, but since this is basic javascript, it should just work. :)

提交回复
热议问题