mirror of https://github.com/zulip/zulip.git
message_list_view: Extract `_get_msg_timestring` method.
This method gets the timestring for the message container when the message was last edited.
This commit is contained in:
parent
d93f5b2977
commit
860406d1ad
|
@ -191,14 +191,19 @@ MessageListView.prototype = {
|
|||
// trigger a re-render
|
||||
_RENDER_THRESHOLD: 50,
|
||||
|
||||
_add_msg_timestring: function (message_container) {
|
||||
_get_msg_timestring: function (message_container) {
|
||||
if (message_container.msg.last_edit_timestamp !== undefined) {
|
||||
// Add or update the last_edit_timestr
|
||||
var last_edit_time = new XDate(message_container.msg.last_edit_timestamp * 1000);
|
||||
var today = new XDate();
|
||||
message_container.last_edit_timestr =
|
||||
timerender.render_date(last_edit_time, undefined, today)[0].textContent
|
||||
+ " at " + timerender.stringify_time(last_edit_time);
|
||||
return timerender.render_date(last_edit_time, undefined, today)[0].textContent +
|
||||
" at " + timerender.stringify_time(last_edit_time);
|
||||
}
|
||||
},
|
||||
|
||||
_add_msg_timestring: function (message_container) {
|
||||
var last_edit_timestr = this._get_msg_timestring(message_container);
|
||||
if (last_edit_timestr !== undefined) {
|
||||
message_container.last_edit_timestr = last_edit_timestr;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue