Now updating timestamps on the Everyone timeline. Also reduced polling duration from 5s to 3s.

parent b9cad0f4
......@@ -78,5 +78,18 @@ window.addEventListener('load', function(){
// Update the repeater node
set(repeaterNode, {messages: posts})
});
}, 5000);
// Update all the message clocks
var postDates = document.getElementsByClassName('postDate');
for (var i = 0; i < postDates.length; i++)
{
var postDate = postDates[i];
var timestamp = (postDate.getAttribute('data-timestamp')).replace (/_/g, ':');
var timeOfPost = new Date(timestamp);
var humanTime = moment(timeOfPost).fromNow();
postDate.innerHTML = humanTime + " ";
}
}, 3000);
});
......@@ -24,7 +24,7 @@
<div class="image-and-body">
<img class="profileImage" data-set-attribute='src message.key profileImagePathFormatter'>
<div class="bodyText" data-set-text='html message.value'>Message body HTML</div>
<div class="meta"><span data-set-text='message.key postDateFormatter'></span><span data-set-text='message.key personFormatter'></span> <a data-set-attribute='href message.key addFriendLinkFormatter' data-set-text='html message.key addFriendTextFormatter'></a></div>
<div class="meta"><span class='postDate' data-set-attribute='data-timestamp message.key' data-set-text='message.key postDateFormatter'></span><span data-set-text='message.key personFormatter'></span> <a data-set-attribute='href message.key addFriendLinkFormatter' data-set-text='html message.key addFriendTextFormatter'></a></div>
</div>
</div>
<!-- <div class='messageStatus' data-set-attribute='id message.key messageStatusIDFormatter'></div>-->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment