What.CD : Relative to Absolute Time

Changes the relative time format to an absolute date.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @id             whatcd-absolute-time
// @name           What.CD : Relative to Absolute Time
// @version        1.5
// @namespace      hateradio)))
// @author         hateradio
// @description    Changes the relative time format to an absolute date.
// @include        http*://*what.cd/*
// ==/UserScript==

var timeChange = {
	f : 'day month date, year (hour:min)',
	t : document.querySelectorAll('.time'),
	m : ['Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec'],
	// m : ['January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December'],
	d : ['Sun', 'Mon' , 'Tues' , 'Weds' , 'Thurs' , 'Fri' , 'Sat'],
	now : function(){
		var i = this.t.length, t, f;
		while(i--){
			t = this.t[i];
			f = new Date(t.title);
			t.title = t.textContent;
			t.textContent = this.s(f);
		}
	},
	s : function(date){
			var a = this.f.split(/\W/).reverse(), i = a.length, d, s = this.f;
			while(i--){
				d = a[i];
				switch(d){
					case 'date' : s = s.replace('date', date.getDate()); break;
					case 'day' : s = s.replace('day', this.d[date.getDay()]); break;
					case 'year' : s = s.replace('year', date.getFullYear()); break;
					case 'hour' : s = s.replace('hour', date.getHours()); break;
					case 'min' : s = s.replace('min', date.getMinutes()); break;
					case 'month' : s = s.replace('month', this.m[date.getMonth()]); break;
					default : break;
				}
			}
			return s;
	}
};

timeChange.now();