Merge branch 'MDL-65114-master' of https://github.com/snake/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2019-04-04 20:41:40 +02:00
3 changed files with 18 additions and 2 deletions
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);
@@ -87,7 +87,13 @@
data-region="last-message-date"
>
{{#lastmessagedate}}
{{#userdate}} {{.}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
{{#istoday}}
{{#userdate}} {{.}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
{{/istoday}}
{{^istoday}}
{{#userdate}} {{.}}, {{#str}} strftimedatefullshort, core_langconfig {{/str}} {{/userdate}}
{{/istoday}}
{{/lastmessagedate}}
</div>
<div class="d-flex align-self-center align-items-center">