ISO time format for StackOverflow

Use ISO time format for Stack Overlow

Verze ze dne 02. 09. 2019. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name               ISO time format for StackOverflow
// @version            1.0
// @name:zh-CN         为 Stack Overflow 启用 ISO 时间格式
// @description        Use ISO time format for Stack Overlow
// @description:zh-CN  Stack Overflow 使用的时间格式并不那么友好(至少对我来说),临时抱佛脚学了几句JS,将其默认时间格式改为ISO格式的
// @namespace          StackOverflow
// @author             Patrick
// @match              https://stackoverflow.com/questions/*
// @grant              none
// @run-at             document-end
// ==/UserScript==

window.addEventListener('load', function(){
    var i, time_list;
    time_list = document.getElementsByClassName("relativetime");
    for (i = 0; i < time_list.length; i++) {
        [time_list[i].title,time_list[i].innerText] = [time_list[i].innerText,time_list[i].title];
    }
    time_list = document.getElementsByClassName("relativetime-clean");
    for (i = 0; i < time_list.length; i++) {
        [time_list[i].title,time_list[i].innerText] = [time_list[i].innerText,time_list[i].title];
    }
}, false);