@@ -19,7 +19,7 @@ import { CHAT_TYPE } from '@constants/chat';
19
19
import { PATH_NAME } from '@constants/pathName' ;
20
20
21
21
import { MODAL_CONTENTS } from '../constants/modalContents' ;
22
- import { formatDateString , getKoreanDay } from '../services/formatDate' ;
22
+ import { formatDateString , getSlicedTime } from '../services/formatDate' ;
23
23
import { useQuitCondition } from '../services/quitChatCondition' ;
24
24
import {
25
25
connect ,
@@ -75,8 +75,10 @@ export const useChattingPage = () => {
75
75
return [ ...prevChats , dateSystemMessage , chat ] ;
76
76
}
77
77
78
- const prevCreatedAt = getKoreanDay ( prevChatMessages [ idx - 1 ] . createdAt ) ;
79
- const curCreatedAt = getKoreanDay ( chat . createdAt ) ;
78
+ const prevCreatedAt = getSlicedTime (
79
+ prevChatMessages [ idx - 1 ] . createdAt
80
+ ) ;
81
+ const curCreatedAt = getSlicedTime ( chat . createdAt ) ;
80
82
81
83
if ( prevCreatedAt !== curCreatedAt ) {
82
84
const dateSystemMessage = createDateSystemMessage ( chat ) ;
@@ -115,11 +117,11 @@ export const useChattingPage = () => {
115
117
roomId,
116
118
subscribeEvent : ( received : ChatMessage ) =>
117
119
setChatMessages ( ( prev : ChatMessage [ ] ) => {
118
- const prevCreatedAt = getKoreanDay (
120
+ const prevCreatedAt = getSlicedTime (
119
121
prev [ prev . length - 1 ] . createdAt
120
122
) ;
121
123
122
- const curCreatedAt = getKoreanDay ( received . createdAt ) ;
124
+ const curCreatedAt = getSlicedTime ( received . createdAt ) ;
123
125
124
126
if ( prevCreatedAt !== curCreatedAt ) {
125
127
const dateSystemMessage = createDateSystemMessage ( received ) ;
0 commit comments