diff --git a/DSL/Resql/users/get-cs-all-ended-chats.sql b/DSL/Resql/users/get-cs-all-ended-chats.sql index e217966b..7b679932 100644 --- a/DSL/Resql/users/get-cs-all-ended-chats.sql +++ b/DSL/Resql/users/get-cs-all-ended-chats.sql @@ -61,7 +61,7 @@ MaxChats AS ( FROM chat WHERE ended IS NOT NULL AND status <> 'IDLE' - AND created::date BETWEEN :start::date AND :end::date + AND ended::date BETWEEN :start::date AND :end::date GROUP BY base_id ), EndedChatMessages AS ( diff --git a/GUI/src/pages/HistoricalConversations/History/index.tsx b/GUI/src/pages/HistoricalConversations/History/index.tsx index fa8cd706..5ac50907 100644 --- a/GUI/src/pages/HistoricalConversations/History/index.tsx +++ b/GUI/src/pages/HistoricalConversations/History/index.tsx @@ -163,8 +163,8 @@ const History: FC = () => { setFilteredEndedChatsList( chatsList.filter((c) => { - const created = Date.parse(format(new Date(c.created), 'MM/dd/yyyy')); - return created >= startDate && created <= endDate; + const ended = Date.parse(format(new Date(c.ended), 'MM/dd/yyyy')); + return ended >= startDate && ended <= endDate; }) ); };