Github remove relative date stupidness

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);
})();