2016-08-05 11:39:31 +00:00
|
|
|
/**
|
|
|
|
* Created by Norbi on 2016-08-05.
|
|
|
|
*/
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
var cmsgs = document.getElementById("channelmessages");
|
2016-08-09 10:12:46 +00:00
|
|
|
if (cmsgs != null && cmsgs.childElementCount > 0) {
|
2016-08-10 12:05:30 +00:00
|
|
|
var nodes = cmsgs.children;
|
|
|
|
for (var x = 0; x < nodes.length; x++) {
|
|
|
|
var item = nodes[x];
|
|
|
|
console.log(item);
|
|
|
|
var spans = item.getElementsByTagName("span");
|
|
|
|
var ctime = null;
|
|
|
|
for (var i = 0; i < spans.length; i++)
|
|
|
|
if (spans[i].className.split(' ').indexOf("converttime") > -1)
|
|
|
|
ctime = spans[i];
|
|
|
|
if (ctime != null)
|
|
|
|
ctime.innerText = moment(ctime.innerText).format("lll");
|
|
|
|
//ctime.innerText = new Date(ctime.innerText * 1).toDateString();
|
|
|
|
}
|
2016-08-05 11:39:31 +00:00
|
|
|
cmsgs.lastElementChild.scrollIntoView(false);
|
2016-08-09 10:12:46 +00:00
|
|
|
}
|
2016-08-05 11:39:31 +00:00
|
|
|
});
|