Commit d0055da2 by Lee Munkyeong

Merge branch 'features/#42530_message_date_format' into 'release_sp3'

Features/#42530 message date format

See merge request !69
parents 863ac0a1 0d376f96
...@@ -594,10 +594,10 @@ input[name="tab_item"] { ...@@ -594,10 +594,10 @@ input[name="tab_item"] {
/* 既読エリア */ /* 既読エリア */
.room_left .date { .room_left .date {
position: absolute; position: absolute;
width: 80px; width: 110px;
text-align: left; text-align: left;
top: 30px; top: 30px;
right: -90px; right: -120px;
font-size: 12px; font-size: 12px;
} }
...@@ -634,7 +634,7 @@ input[name="tab_item"] { ...@@ -634,7 +634,7 @@ input[name="tab_item"] {
background-color: #0070ca; background-color: #0070ca;
color: #fff; color: #fff;
margin: 0; margin: 0;
margin-left: 80px; margin-left: 110px;
font-size: 18px; font-size: 18px;
word-break: break-word; word-break: break-word;
} }
...@@ -652,7 +652,7 @@ input[name="tab_item"] { ...@@ -652,7 +652,7 @@ input[name="tab_item"] {
/* 日付 */ /* 日付 */
.room_right .date { .room_right .date {
position: absolute; position: absolute;
width: 80px; width: 110px;
text-align: right; text-align: right;
top: 0px; top: 0px;
left: -10px; left: -10px;
......
...@@ -1142,6 +1142,7 @@ CHAT_UI.joinRoom = function(roomId,roomName) { ...@@ -1142,6 +1142,7 @@ CHAT_UI.joinRoom = function(roomId,roomName) {
}; };
CHAT_UI.loadMessages = function(roomId, roomName) { CHAT_UI.loadMessages = function(roomId, roomName) {
var now = new Date();
if (IS_ONLINE == 'true') { if (IS_ONLINE == 'true') {
CHAT_UI.refreshForOnline(); CHAT_UI.refreshForOnline();
if (typeof(android) != "undefined") { if (typeof(android) != "undefined") {
...@@ -1243,11 +1244,14 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1243,11 +1244,14 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
message.message = replacePath; message.message = replacePath;
/* if (message.message contain) { /* if (message.message contain) {
}*/ }*/
var isOtherYear = false;
var isToday = false; var isToday = false;
if (messageTime.createdAt.includes(':')) { if (messageTime.createdAt.includes(':')) {
isToday = true; isToday = true;
} }
if (now.getFullYear() != message.insertDate.substring(0,4)) {
isOtherYear = true;
}
if (messageTime.createdAtDay != checkBeforeDate && checkBeforeDate != "") { if (messageTime.createdAtDay != checkBeforeDate && checkBeforeDate != "") {
let messageDay = CHAT_UTIL.systemDay(beforeDate); let messageDay = CHAT_UTIL.systemDay(beforeDate);
let html = Mustache.render(systemMessageTemplate, { let html = Mustache.render(systemMessageTemplate, {
...@@ -1261,7 +1265,6 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1261,7 +1265,6 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
} }
checkBeforeDate = messageTime.createdAtDay; checkBeforeDate = messageTime.createdAtDay;
beforeDate = message.insertDate; beforeDate = message.insertDate;
let html = Mustache.render(template, { let html = Mustache.render(template, {
text: message.message, text: message.message,
from: message.loginId, from: message.loginId,
...@@ -1269,7 +1272,9 @@ CHAT_UI.loadMessages = function(roomId, roomName) { ...@@ -1269,7 +1272,9 @@ CHAT_UI.loadMessages = function(roomId, roomName) {
profileImage: message.profileUrl, profileImage: message.profileUrl,
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime, createdAtTime: messageTime.createdAtTime,
createdAtYear: message.insertDate.substring(0,4) + getLocalizedString('year') + ' ',
unreadCount: message.unreadCount, unreadCount: message.unreadCount,
isOtherYear: isOtherYear,
isToday: isToday isToday: isToday
}); });
html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html; html = message.message.includes('attachedImages') || message.message.includes('attachedVideos') ? CHAT_UTIL.htmlDecode(html) : html;
......
...@@ -4,7 +4,12 @@ ...@@ -4,7 +4,12 @@
<div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div>
{{/isToday}} {{/isToday}}
{{^isToday}} {{^isToday}}
{{#isOtherYear}}
<div class="date d-flex flex-column"><span>{{createdAtYear}} {{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isOtherYear}}
{{^isOtherYear}}
<div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isOtherYear}}
{{/isToday}} {{/isToday}}
{{#unreadCount}} {{#unreadCount}}
<div class="unread d-flex align-items-end"><span>{{unreadCount}}</span></div> <div class="unread d-flex align-items-end"><span>{{unreadCount}}</span></div>
......
...@@ -12,7 +12,12 @@ ...@@ -12,7 +12,12 @@
<div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span></span><span>{{createdAtTime}}</span></div>
{{/isToday}} {{/isToday}}
{{^isToday}} {{^isToday}}
{{#isOtherYear}}
<div class="date d-flex flex-column"><span>{{createdAtYear}} {{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isOtherYear}}
{{^isOtherYear}}
<div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div> <div class="date d-flex flex-column"><span>{{createdAtDay}}</span><span>{{createdAtTime}}</span></div>
{{/isOtherYear}}
{{/isToday}} {{/isToday}}
{{#unreadCount}} {{#unreadCount}}
<div class="unread d-flex align-items-end"><span>{{unreadCount}}</span></div> <div class="unread d-flex align-items-end"><span>{{unreadCount}}</span></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