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