Github remove relative date stupidness

Removes relative date stamps on Github commits, and shows actual date/time created.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Github remove relative date stupidness
// @description Removes relative date stamps on Github commits, and shows actual date/time created.
// @namespace   http://www.wilcoxd.com
// @include     https://github.com*
// @version     1
// @grant       none
// ==/UserScript==

// created: WD-rpw 03-25-2013

/*
	if you don't like this there are two other Greasemonkey scripts that do the
	same thing, although in a more complicated way:

	  1. http://userscripts.org/scripts/show/107649
	  2. http://userscripts.org/scripts/show/107649

*/

(function() {

	function parseDate(date) {
    	var m = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z/.exec(date);
    	var tzOffset = new Date(+m[1], +m[2] - 1, +m[3], +m[4], +m[5], +m[6]).getTimezoneOffset();

    	return new Date(+m[1], +m[2] - 1, +m[3], +m[4], +m[5] - tzOffset, +m[6]);
	}
	function format(el) {
		$el = $(el);
		$el.removeAttr("is");
		var time = $el.attr('title')||$el.attr("datetime");
		var formatted = time + " UTC";
		var dateObj = parseDate(formatted);

		if (dateObj)
			formatted = dateObj.toLocaleString();

		$el.html( formatted );
	}

	function onDOMSubtreeModifiedHandler(e){
		var target = e.target;
		if(target.nodeType === 1 && /TIME/ig.test(target.nodeName)&&/ago/.test(target.innerHTML)) {
			format(target);
		}
	}
	$("time[is='relative-time']").each( function(index, el) {
		format(el);
	});

	document.addEventListener('DOMSubtreeModified', onDOMSubtreeModifiedHandler, false);
})();