Skip to content

Commit 1b98e81

Browse files
committed
MOBILE-2103 chat: Update sessionstart string
1 parent 42c6cfa commit 1b98e81

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

www/addons/mod/chat/controllers/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ angular.module('mm.addons.mod_chat')
4242
$scope.title = chat.name || $scope.title;
4343
$scope.description = chat.intro || $scope.description;
4444
$scope.chatId = chat.id;
45-
$scope.chatScheduled = '';
4645

4746
var now = $mmUtil.timestamp();
4847
var span = chat.chattime - now;
4948

5049
if (chat.chattime && chat.schedule > 0 && span > 0) {
51-
$scope.chatScheduled = $mmUtil.formatTimeInstant(span);
50+
$scope.chatInfo = {
51+
date: moment(chat.chattime * 1000).format('LLL'),
52+
fromnow: $mmUtil.formatTimeInstant(span)
53+
};
54+
} else {
55+
$scope.chatInfo = false;
5256
}
5357

5458
}, function(error) {

www/addons/mod/chat/lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"mustbeonlinetosendmessages": "You must be online to send messages",
1515
"nomessages": "No messages yet",
1616
"send": "Send",
17-
"sessionstart": "The next chat session will start in {{$a}}",
17+
"sessionstart": "The next chat session will start on {{$a.date}}, ({{$a.fromnow}} from now)",
1818
"talk": "Talk"
1919
}

www/addons/mod/chat/templates/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<mm-loading hide-until="chatLoaded">
1414
<mm-course-mod-description watch="true" description="description" component="{{component}}" component-id="{{componentId}}"></mm-course-mod-description>
1515

16-
<div class="mm-info-card-icon" ng-if="chatScheduled != ''">
17-
<i class="icon ion-clock padding"></i> {{ 'mma.mod_chat.sessionstart' | translate:{$a: chatScheduled} }}
16+
<div class="mm-info-card-icon" ng-if="chatInfo">
17+
<i class="icon ion-clock padding"></i> {{ 'mma.mod_chat.sessionstart' | translate:{$a: chatInfo} }}
1818
</div>
1919

2020
<a class="button button-block button-positive" ui-sref="site.mod_chat-chat({chatid: chatId, title: title, courseid: courseid})">{{ 'mma.mod_chat.enterchat' | translate }}</a>

0 commit comments

Comments
 (0)