MDL-65114 core_message: date format depends on message age
Messages sent today are displayed using 24 hour time, e.g. "14:21". Older messages are displayed using the format, e.g. "31/01/2019".
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -202,6 +202,12 @@ function(
|
||||
return formattedConversation;
|
||||
});
|
||||
|
||||
formattedConversations.forEach(function(conversation) {
|
||||
if (new Date().toDateString() == new Date(conversation.lastmessagedate * 1000).toDateString()) {
|
||||
conversation.istoday = true;
|
||||
}
|
||||
});
|
||||
|
||||
return Templates.render(TEMPLATES.CONVERSATIONS_LIST, {conversations: formattedConversations})
|
||||
.then(function(html) {
|
||||
contentContainer.append(html);
|
||||
@@ -456,6 +462,10 @@ function(
|
||||
// Cache the conversation.
|
||||
loadedConversationsById[conversation.id] = conversation;
|
||||
|
||||
if (new Date().toDateString() == new Date(formattedConversation.lastmessagedate * 1000).toDateString()) {
|
||||
formattedConversation.istoday = true;
|
||||
}
|
||||
|
||||
return Templates.render(TEMPLATES.CONVERSATIONS_LIST, {conversations: [formattedConversation]})
|
||||
.then(function(html) {
|
||||
var contentContainer = LazyLoadList.getContentContainer(root);
|
||||
|
||||
Reference in New Issue
Block a user