/*
* @title 初回登録日時
* @description 質問登録日時を最初の登録日時に置き換えます。置き換えた場合は日付の頭に「:」が付きます。
* @include http://q.hatena.ne.jp
* @license MIT License
*/
// 文字数詰めたけど何故か外部ローダ経由になる
(function () {
if (location.href.match(/\/(\d+)$/)) {
var i, t = new Date(), n = ["Year", "Date", "Hours", "Minutes", "Seconds"], u = RegExp.$1, s = Ten.Selector.getElementsBySelector("li.subinfo")[3];
t.setTime(u * 1000);
for (i = 0; i < n.length; i++) t[n[i].charAt(0)] = ("0" + t["get" + n[i]]()).slice(-2);
t.O = ("0" + (t.getMonth() + 1)).slice(-2);
u = "20" + [t.Y, t.O, t.D].join("-") + " " + [t.H, t.M, t.S].join(":");
t = s.lastChild;
n = t.nodeValue;
if (n && n.match(/^[\d\s-:]+$/)) {
if (n.indexOf(u) < 0) t.nodeValue = ":" + u;
} else alert("失敗");
}
})();