Etherscan EasyRead

change timestamp on etherscan, make it easier to be analysised.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Etherscan EasyRead
// @namespace    http://tampermonkey.net/
// @version      0.6
// @description  change timestamp on etherscan, make it easier to be analysised.
// @author       verazuo
// @match        https://etherscan.io/address/*
// @match        https://etherscan.io/txs?*
// @match        https://etherscan.io/txsInternal?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var t;
    if (window.location.href.match("https://etherscan.io/address/")){
        t = document.getElementById("transactions");
    } else if (window.location.href.match("https://etherscan.io/txsInternal?")){
        t = document.getElementsByClassName("card-body")[0];
    } else if (window.location.href.match("https://etherscan.io/txs?")){
        t = document.getElementById("ContentPlaceHolder1_mainrow");
    }

    var trs = t.getElementsByTagName('tr');

	for (var i=1;i<trs.length;i++)
	{
		var tr = trs[i].getElementsByTagName("td");
        if(tr.length < 3){
            continue;
        }
        var span;
        if (window.location.href.match("https://etherscan.io/txsInternal?")){
			span = tr[1].getElementsByTagName("span")[0];
        } else {
        	span = tr[2].getElementsByTagName("span")[0];
        }
        if (span === undefined){
 			continue;
        }
        var date = new Date(span.title);
        var myDate = date.getFullYear() + "-" + ("0" + (date.getMonth() + 1)).slice(-2) + "-" + ("0" + date.getDate()).slice(-2) + " " + ("0" + date.getHours()).slice(-2) + ":" + ("0" + date.getMinutes()).slice(-2)+ ":" + ("0" + date.getSeconds()).slice(-2);
        span.innerHTML=myDate;
    }
})();