概要
GitHub 内の至る所で表示される日時が「~ days ago」ってなってるのが正直しっくり来ない。これをぜんぶ年月日時分秒に差し替えるブックマークレットを作った。
ブックマークレット
github-date-expand-bookmarklet
javascript:(function(){$('time').each(function(){var t = new Date($(this).attr('datetime'));var full = '';full += t.getFullYear() + '/';full += ('0' + (t.getMonth() + 1)).slice(-2) + '/';full += ('0' + t.getDate()).slice(-2) + ' ';full += ('0' + t.getHours()).slice(-2) + ':';full += ('0' + t.getMinutes()).slice(-2) + ':';full += ('0' + t.getSeconds()).slice(-2);$(this).text(full);});})();
生コード
github-date-expand.js
$('time').each(function(){
var t = new Date($(this).attr('datetime'));
var full = '';
full += t.getFullYear() + '/';
full += ('0' + (t.getMonth() + 1)).slice(-2) + '/';
full += ('0' + t.getDate()).slice(-2) + ' ';
full += ('0' + t.getHours()).slice(-2) + ':';
full += ('0' + t.getMinutes()).slice(-2) + ':';
full += ('0' + t.getSeconds()).slice(-2);
$(this).text(full);
});