Merge branch 'master' of http://10.81.13.221:6990/Web/next-ucap-messenger
This commit is contained in:
commit
01b59d9bfb
|
@ -5,5 +5,6 @@ services:
|
|||
image: nginx:1.17.5-alpine
|
||||
volumes:
|
||||
- ../dist/ucap-webmessenger-app:/usr/share/nginx/html:ro
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
ports:
|
||||
- 8099:80
|
||||
|
|
40
docker/nginx/nginx.conf
Normal file
40
docker/nginx/nginx.conf
Normal file
|
@ -0,0 +1,40 @@
|
|||
worker_processes 4;
|
||||
|
||||
events { worker_connections 1024; }
|
||||
|
||||
http {
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 30m;
|
||||
|
||||
#See http://blog.argteam.com/coding/hardening-node-js-for-production-part-2-using-nginx-to-avoid-node-js-load
|
||||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m;
|
||||
proxy_temp_path /var/tmp;
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
gzip on;
|
||||
gzip_comp_level 6;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1000;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
gzip_buffers 16 8k;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
expires -1;
|
||||
add_header Pragma "no-cache";
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
|
||||
try_files $uri$args $uri$args/ $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
CommonApiService,
|
||||
MassTalkSaveRequest
|
||||
MassTalkSaveRequest,
|
||||
} from '@ucap-webmessenger/api-common';
|
||||
import { KEY_ENVIRONMENTS_INFO } from './../../../types/environment.type';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
@ -19,8 +19,9 @@ import {
|
|||
catchError,
|
||||
exhaustMap,
|
||||
withLatestFrom,
|
||||
concatMap
|
||||
concatMap,
|
||||
} from 'rxjs/operators';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
InfoData,
|
||||
Info,
|
||||
|
@ -37,7 +38,7 @@ import {
|
|||
ReadNotification,
|
||||
SSVC_TYPE_EVENT_SEND_RES,
|
||||
SSVC_TYPE_EVENT_SEND_NOTI,
|
||||
EventJson
|
||||
EventJson,
|
||||
} from '@ucap-webmessenger/protocol-event';
|
||||
|
||||
import * as ChatStore from '@app/store/messenger/chat';
|
||||
|
@ -73,13 +74,13 @@ import {
|
|||
infoIntervalClear,
|
||||
fileInfo,
|
||||
fileInfoSuccess,
|
||||
fileInfoFailure
|
||||
fileInfoFailure,
|
||||
} from './actions';
|
||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||
import {
|
||||
RoomInfo,
|
||||
RoomProtocolService,
|
||||
OpenResponse
|
||||
OpenResponse,
|
||||
} from '@ucap-webmessenger/protocol-room';
|
||||
import { LoginInfo, KEY_LOGIN_INFO, EnvironmentsInfo } from '@app/types';
|
||||
import { Dictionary } from '@ngrx/entity';
|
||||
|
@ -98,7 +99,7 @@ import {
|
|||
InfoData as FileInfoData,
|
||||
InfoCheckData as FileInfoCheckData,
|
||||
InfoResponse as FileInfoResponse,
|
||||
FileType
|
||||
FileType,
|
||||
} from '@ucap-webmessenger/protocol-file';
|
||||
|
||||
@Injectable()
|
||||
|
@ -110,7 +111,7 @@ export class Effects {
|
|||
return info({
|
||||
roomSeq: action.roomSeq,
|
||||
baseSeq: 0,
|
||||
requestCount: CONST.EVENT_INFO_READ_COUNT
|
||||
requestCount: CONST.EVENT_INFO_READ_COUNT,
|
||||
});
|
||||
})
|
||||
)
|
||||
|
@ -138,14 +139,14 @@ export class Effects {
|
|||
this.store.dispatch(
|
||||
infoSuccess({
|
||||
infoList,
|
||||
res: res as InfoResponse
|
||||
res: res as InfoResponse,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
this.store.dispatch(
|
||||
infoMoreSuccess({
|
||||
infoList,
|
||||
res: res as InfoResponse
|
||||
res: res as InfoResponse,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -160,7 +161,7 @@ export class Effects {
|
|||
this.store.dispatch(
|
||||
read({
|
||||
roomSeq: req.roomSeq,
|
||||
lastReadSeq: Number(maxSeq)
|
||||
lastReadSeq: Number(maxSeq),
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -170,8 +171,8 @@ export class Effects {
|
|||
req: {
|
||||
roomSeq: req.roomSeq,
|
||||
// { 파일타입 } cf) I : 이미지 V: 동영상 F: 파일 "" 빈값이면 모든 타입을 내려줌
|
||||
type: FileType.All
|
||||
}
|
||||
type: FileType.All,
|
||||
},
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -216,7 +217,7 @@ export class Effects {
|
|||
fileInfoSuccess({
|
||||
fileInfoList,
|
||||
fileInfoCheckList,
|
||||
res: res as FileInfoResponse
|
||||
res: res as FileInfoResponse,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -255,7 +256,10 @@ export class Effects {
|
|||
for (const key in eventList) {
|
||||
const event: Info<EventJson> = eventList[key];
|
||||
if (
|
||||
new Date().getTime() - new Date(event.sendDate).getTime() >=
|
||||
new Date().getTime() -
|
||||
moment(event.sendDate)
|
||||
.toDate()
|
||||
.getTime() >=
|
||||
roomInfo.timeRoomInterval * 1000
|
||||
) {
|
||||
delEventSeq.push(event.seq);
|
||||
|
@ -317,7 +321,7 @@ export class Effects {
|
|||
this.store.dispatch(
|
||||
SyncStore.updateUnreadCount({
|
||||
roomSeq: action.roomSeq,
|
||||
noReadCnt: 0
|
||||
noReadCnt: 0,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -335,7 +339,7 @@ export class Effects {
|
|||
map((res: SendResponse) => {
|
||||
return sendSuccess({
|
||||
senderSeq: action.senderSeq,
|
||||
res
|
||||
res,
|
||||
});
|
||||
}),
|
||||
catchError(error => of(sendFailure({ error })))
|
||||
|
@ -356,7 +360,7 @@ export class Effects {
|
|||
roomSeq: res.roomSeq,
|
||||
info: res.info,
|
||||
SVC_TYPE: res.SVC_TYPE,
|
||||
SSVC_TYPE: res.SSVC_TYPE
|
||||
SSVC_TYPE: res.SSVC_TYPE,
|
||||
})
|
||||
);
|
||||
})
|
||||
|
@ -376,7 +380,7 @@ export class Effects {
|
|||
roomSeq: noti.roomSeq,
|
||||
info: noti.info,
|
||||
SVC_TYPE: noti.SVC_TYPE,
|
||||
SSVC_TYPE: noti.SSVC_TYPE
|
||||
SSVC_TYPE: noti.SSVC_TYPE,
|
||||
})
|
||||
);
|
||||
})
|
||||
|
@ -400,8 +404,8 @@ export class Effects {
|
|||
req: {
|
||||
roomSeq: action.trgtRoomSeq,
|
||||
eventType: action.req.eventType,
|
||||
sentMessage: action.req.sentMessage
|
||||
}
|
||||
sentMessage: action.req.sentMessage,
|
||||
},
|
||||
})
|
||||
);
|
||||
} else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) {
|
||||
|
@ -421,7 +425,7 @@ export class Effects {
|
|||
return this.roomProtocolService
|
||||
.open({
|
||||
divCd: 'forwardOpen',
|
||||
userSeqs: action.trgtUserSeqs
|
||||
userSeqs: action.trgtUserSeqs,
|
||||
})
|
||||
.pipe(
|
||||
map((res: OpenResponse) => {
|
||||
|
@ -434,8 +438,8 @@ export class Effects {
|
|||
req: {
|
||||
roomSeq: res.res.roomSeq,
|
||||
eventType: action.req.eventType,
|
||||
sentMessage: action.req.sentMessage
|
||||
}
|
||||
sentMessage: action.req.sentMessage,
|
||||
},
|
||||
})
|
||||
);
|
||||
return res;
|
||||
|
@ -464,7 +468,7 @@ export class Effects {
|
|||
deviceType: environmentsInfo.deviceType,
|
||||
token: loginResInfo.tokenString,
|
||||
content: action.req.sentMessage,
|
||||
roomSeq: action.req.roomSeq
|
||||
roomSeq: action.req.roomSeq,
|
||||
};
|
||||
|
||||
return this.commonApiService.massTalkSave(req).pipe(
|
||||
|
@ -476,8 +480,8 @@ export class Effects {
|
|||
req: {
|
||||
roomSeq: res.roomSeq,
|
||||
eventType: EventType.MassText,
|
||||
sentMessage: res.returnJson
|
||||
}
|
||||
sentMessage: res.returnJson,
|
||||
},
|
||||
})
|
||||
);
|
||||
} else {
|
||||
|
@ -519,7 +523,7 @@ export class Effects {
|
|||
this.store.dispatch(
|
||||
read({
|
||||
roomSeq: action.roomSeq,
|
||||
lastReadSeq: action.info.seq
|
||||
lastReadSeq: action.info.seq,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -541,7 +545,7 @@ export class Effects {
|
|||
this.store.dispatch(
|
||||
SyncStore.updateUnreadCount({
|
||||
roomSeq: action.roomSeq,
|
||||
noReadCnt: noReadCnt + 1
|
||||
noReadCnt: noReadCnt + 1,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -594,7 +598,7 @@ export class Effects {
|
|||
SyncStore.refreshRoom({
|
||||
roomSeq: action.noti.roomSeq,
|
||||
isDetail: true,
|
||||
localeCode: loginInfo.localeCode
|
||||
localeCode: loginInfo.localeCode,
|
||||
})
|
||||
);
|
||||
})
|
||||
|
@ -641,7 +645,7 @@ export class Effects {
|
|||
SyncStore.refreshRoom({
|
||||
roomSeq: noti.roomSeq,
|
||||
isDetail: true,
|
||||
localeCode: loginInfo.localeCode
|
||||
localeCode: loginInfo.localeCode,
|
||||
})
|
||||
);
|
||||
})
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
import { Selector, createSelector } from '@ngrx/store';
|
||||
import { EntityState, createEntityAdapter } from '@ngrx/entity';
|
||||
import moment from 'moment';
|
||||
import {
|
||||
UserInfo,
|
||||
GroupDetailData,
|
||||
RoomUserData,
|
||||
RoomUserDetailData
|
||||
RoomUserDetailData,
|
||||
} from '@ucap-webmessenger/protocol-sync';
|
||||
import {
|
||||
RoomInfo,
|
||||
UserInfo as RoomUserInfo
|
||||
UserInfo as RoomUserInfo,
|
||||
} from '@ucap-webmessenger/protocol-room';
|
||||
|
||||
export interface Buddy2State extends EntityState<UserInfo> {
|
||||
|
@ -37,7 +38,7 @@ export interface State {
|
|||
}
|
||||
|
||||
export const adapterBuddy2 = createEntityAdapter<UserInfo>({
|
||||
selectId: userInfo => userInfo.seq
|
||||
selectId: userInfo => userInfo.seq,
|
||||
});
|
||||
export const adapterGroup2 = createEntityAdapter<GroupDetailData>({
|
||||
selectId: groupDetailData => groupDetailData.seq,
|
||||
|
@ -56,32 +57,36 @@ export const adapterGroup2 = createEntityAdapter<GroupDetailData>({
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
export const adapterRoom = createEntityAdapter<RoomInfo>({
|
||||
selectId: roomInfo => roomInfo.roomSeq,
|
||||
sortComparer: (a, b) => {
|
||||
return (
|
||||
new Date(b.finalEventDate).getTime() -
|
||||
new Date(a.finalEventDate).getTime()
|
||||
moment(b.finalEventDate)
|
||||
.toDate()
|
||||
.getTime() -
|
||||
moment(a.finalEventDate)
|
||||
.toDate()
|
||||
.getTime()
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
export const adapterRoomUser = createEntityAdapter<RoomUserDetailData>({
|
||||
selectId: roomUserDetailData => roomUserDetailData.roomSeq
|
||||
selectId: roomUserDetailData => roomUserDetailData.roomSeq,
|
||||
});
|
||||
export const adapterRoomUserShort = createEntityAdapter<RoomUserData>({
|
||||
selectId: roomUserData => roomUserData.roomSeq
|
||||
selectId: roomUserData => roomUserData.roomSeq,
|
||||
});
|
||||
|
||||
const buddy2InitialState: Buddy2State = adapterBuddy2.getInitialState({
|
||||
syncDate: ''
|
||||
syncDate: '',
|
||||
});
|
||||
const group2InitialState: Group2State = adapterGroup2.getInitialState({
|
||||
syncDate: ''
|
||||
syncDate: '',
|
||||
});
|
||||
const roomInitialState: RoomState = adapterRoom.getInitialState({
|
||||
syncDate: ''
|
||||
syncDate: '',
|
||||
});
|
||||
const roomUserInitialState: RoomUserState = adapterRoomUser.getInitialState({});
|
||||
const roomUserShortInitialState: RoomUserShortState = adapterRoomUserShort.getInitialState(
|
||||
|
@ -94,59 +99,50 @@ export const initialState: State = {
|
|||
room: roomInitialState,
|
||||
roomUser: roomUserInitialState,
|
||||
roomUserShort: roomUserShortInitialState,
|
||||
chatUnreadCount: 0
|
||||
chatUnreadCount: 0,
|
||||
};
|
||||
|
||||
const {
|
||||
selectAll: ngeSelectAllBuddy2,
|
||||
selectEntities: ngeSelectEntitiesBuddy2,
|
||||
selectIds: ngeSelectIdsBuddy2,
|
||||
selectTotal: ngeSelectTotalBuddy2
|
||||
selectTotal: ngeSelectTotalBuddy2,
|
||||
} = adapterBuddy2.getSelectors();
|
||||
|
||||
const {
|
||||
selectAll: ngeSelectAllGroup2,
|
||||
selectEntities: ngeSelectEntitiesGroup2,
|
||||
selectIds: ngeSelectIdsGroup2,
|
||||
selectTotal: ngeSelectTotalGroup2
|
||||
selectTotal: ngeSelectTotalGroup2,
|
||||
} = adapterGroup2.getSelectors();
|
||||
|
||||
const {
|
||||
selectAll: ngeSelectAllRoom,
|
||||
selectEntities: ngeSelectEntitiesRoom,
|
||||
selectIds: ngeSelectIdsRoom,
|
||||
selectTotal: ngeSelectTotalRoom
|
||||
selectTotal: ngeSelectTotalRoom,
|
||||
} = adapterRoom.getSelectors();
|
||||
|
||||
const {
|
||||
selectAll: ngeSelectAllRoomUser,
|
||||
selectEntities: ngeSelectEntitiesRoomUser,
|
||||
selectIds: ngeSelectIdsRoomUser,
|
||||
selectTotal: ngeSelectTotalRoomUser
|
||||
selectTotal: ngeSelectTotalRoomUser,
|
||||
} = adapterRoomUser.getSelectors();
|
||||
|
||||
const {
|
||||
selectAll: ngeSelectAllRoomUserShort,
|
||||
selectEntities: ngeSelectEntitiesRoomUserShort,
|
||||
selectIds: ngeSelectIdsRoomUserShort,
|
||||
selectTotal: ngeSelectTotalRoomUserShort
|
||||
selectTotal: ngeSelectTotalRoomUserShort,
|
||||
} = adapterRoomUserShort.getSelectors();
|
||||
|
||||
export function selectors<S>(selector: Selector<any, State>) {
|
||||
const selectBuddy2 = createSelector(
|
||||
selector,
|
||||
(state: State) => state.buddy2
|
||||
);
|
||||
const selectBuddy2 = createSelector(selector, (state: State) => state.buddy2);
|
||||
|
||||
const selectGroup2 = createSelector(
|
||||
selector,
|
||||
(state: State) => state.group2
|
||||
);
|
||||
const selectGroup2 = createSelector(selector, (state: State) => state.group2);
|
||||
|
||||
const selectRoom = createSelector(
|
||||
selector,
|
||||
(state: State) => state.room
|
||||
);
|
||||
const selectRoom = createSelector(selector, (state: State) => state.room);
|
||||
|
||||
const selectRoomUser = createSelector(
|
||||
selector,
|
||||
|
@ -159,34 +155,22 @@ export function selectors<S>(selector: Selector<any, State>) {
|
|||
);
|
||||
|
||||
return {
|
||||
selectAllBuddy2: createSelector(
|
||||
selectBuddy2,
|
||||
ngeSelectAllBuddy2
|
||||
),
|
||||
selectAllBuddy2: createSelector(selectBuddy2, ngeSelectAllBuddy2),
|
||||
selectBuddy2SyncDate: createSelector(
|
||||
selectBuddy2,
|
||||
buddy2State => buddy2State.syncDate
|
||||
),
|
||||
selectAllGroup2: createSelector(
|
||||
selectGroup2,
|
||||
ngeSelectAllGroup2
|
||||
),
|
||||
selectAllGroup2: createSelector(selectGroup2, ngeSelectAllGroup2),
|
||||
selectGroup2SyncDate: createSelector(
|
||||
selectGroup2,
|
||||
group2State => group2State.syncDate
|
||||
),
|
||||
selectAllRoom: createSelector(
|
||||
selectRoom,
|
||||
ngeSelectAllRoom
|
||||
),
|
||||
selectAllRoom: createSelector(selectRoom, ngeSelectAllRoom),
|
||||
selectRoomSyncDate: createSelector(
|
||||
selectRoom,
|
||||
roomState => roomState.syncDate
|
||||
),
|
||||
selectAllRoomUser: createSelector(
|
||||
selectRoomUser,
|
||||
ngeSelectAllRoomUser
|
||||
),
|
||||
selectAllRoomUser: createSelector(selectRoomUser, ngeSelectAllRoomUser),
|
||||
selectAllRoomUserShort: createSelector(
|
||||
selectRoomUserShort,
|
||||
ngeSelectAllRoomUserShort
|
||||
|
@ -194,6 +178,6 @@ export function selectors<S>(selector: Selector<any, State>) {
|
|||
selectChatUnreadCount: createSelector(
|
||||
selector,
|
||||
(state: State) => state.chatUnreadCount
|
||||
)
|
||||
),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Info, EventJson } from '@ucap-webmessenger/protocol-event';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'ucap-chat-message-box-date-splitter',
|
||||
templateUrl: './date-splitter.component.html',
|
||||
styleUrls: ['./date-splitter.component.scss']
|
||||
styleUrls: ['./date-splitter.component.scss'],
|
||||
})
|
||||
export class DateSplitterComponent implements OnInit {
|
||||
@Input()
|
||||
|
@ -17,7 +18,7 @@ export class DateSplitterComponent implements OnInit {
|
|||
|
||||
ngOnInit() {
|
||||
this.dateInfo = this.datePipe.transform(
|
||||
this.message.sendDate,
|
||||
moment(this.message.sendDate).toDate(),
|
||||
'yyyy.MM.dd EEE'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="bubble-main">
|
||||
<span class="content" [innerHTML]="content | linefeedtohtml"></span>
|
||||
<span>
|
||||
{{ message.sendDate | date: 'short' }}
|
||||
{{ moment(message.sendDate).toDate() | date: 'short' }}
|
||||
</span>
|
||||
</div>
|
||||
<div *ngIf="detailButteonShow" class="btn-box">
|
||||
|
|
|
@ -2,11 +2,12 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|||
import { Info, MassTextEventJson } from '@ucap-webmessenger/protocol-event';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
import { StatusCode } from '@ucap-webmessenger/api';
|
||||
import moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'ucap-chat-message-box-mass',
|
||||
templateUrl: './mass.component.html',
|
||||
styleUrls: ['./mass.component.scss']
|
||||
styleUrls: ['./mass.component.scss'],
|
||||
})
|
||||
export class MassComponent implements OnInit {
|
||||
@Input()
|
||||
|
@ -19,6 +20,8 @@ export class MassComponent implements OnInit {
|
|||
eventMassSeq: number;
|
||||
detailButteonShow = true;
|
||||
|
||||
moment = moment;
|
||||
|
||||
constructor(private logger: NGXLogger) {}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
<ul>
|
||||
<li>{{ getUnreadCount(message) }}</li>
|
||||
<li>
|
||||
{{ message.sendDate | date: 'a hh:mm' }}
|
||||
{{ moment(message.sendDate).toDate() | date: 'a hh:mm' }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
Input,
|
||||
EventEmitter,
|
||||
Output,
|
||||
ViewEncapsulation
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
|
||||
import {
|
||||
|
@ -13,7 +13,7 @@ import {
|
|||
EventType,
|
||||
InfoResponse,
|
||||
EventJson,
|
||||
FileEventJson
|
||||
FileEventJson,
|
||||
} from '@ucap-webmessenger/protocol-event';
|
||||
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
||||
import { UserInfo } from '@ucap-webmessenger/protocol-room';
|
||||
|
@ -21,11 +21,12 @@ import { NGXLogger } from 'ngx-logger';
|
|||
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||
import { FileInfo } from '../models/file-info.json';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import moment from 'moment';
|
||||
|
||||
@Component({
|
||||
selector: 'ucap-chat-messages',
|
||||
templateUrl: './messages.component.html',
|
||||
styleUrls: ['./messages.component.scss']
|
||||
styleUrls: ['./messages.component.scss'],
|
||||
})
|
||||
export class MessagesComponent implements OnInit {
|
||||
@Input()
|
||||
|
@ -60,6 +61,7 @@ export class MessagesComponent implements OnInit {
|
|||
EventType = EventType;
|
||||
CONST = CONST;
|
||||
profileImageRoot: string;
|
||||
moment = moment;
|
||||
|
||||
constructor(private logger: NGXLogger, private datePipe: DatePipe) {}
|
||||
|
||||
|
@ -147,11 +149,11 @@ export class MessagesComponent implements OnInit {
|
|||
if (curIndex > 0) {
|
||||
return (
|
||||
this.datePipe.transform(
|
||||
this.messages[curIndex].sendDate,
|
||||
moment(this.messages[curIndex].sendDate).toDate(),
|
||||
'yyyyMMdd'
|
||||
) !==
|
||||
this.datePipe.transform(
|
||||
this.messages[curIndex - 1].sendDate,
|
||||
moment(this.messages[curIndex - 1].sendDate).toDate(),
|
||||
'yyyyMMdd'
|
||||
)
|
||||
);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { StringUtil } from '../utils/string.util';
|
||||
import moment from 'moment';
|
||||
|
||||
@Pipe({
|
||||
name: 'dateToStringChatList',
|
||||
|
@ -10,7 +11,7 @@ export class DateToStringForChatRoomListPipe implements PipeTransform {
|
|||
const yesterDate = new Date(curDate.getTime() - 1 * 24 * 60 * 60 * 1000);
|
||||
let date: Date;
|
||||
if (typeof value === 'string') {
|
||||
date = new Date(value.toString());
|
||||
date = moment(value.toString()).toDate();
|
||||
} else if (value instanceof Date) {
|
||||
date = value;
|
||||
} else {
|
||||
|
@ -42,7 +43,7 @@ export class DateToStringForChatRoomListPipe implements PipeTransform {
|
|||
})
|
||||
export class DateToStringFormatPipe implements PipeTransform {
|
||||
transform(value: any, format?: string): string {
|
||||
const date = new Date(value.toString());
|
||||
const date = moment(value.toString()).toDate();
|
||||
|
||||
if (!!format) {
|
||||
return StringUtil.dateFormat(date, format);
|
||||
|
|
Loading…
Reference in New Issue
Block a user