Skip to content

Commit

Permalink
refactor(chat): Use dateSerialization
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Sep 27, 2024
1 parent 9feb246 commit bb5cf3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/devextreme/js/__internal/ui/chat/messagelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import domAdapter from '@js/core/dom_adapter';
import type { dxElementWrapper } from '@js/core/renderer';
import $ from '@js/core/renderer';
import resizeObserverSingleton from '@js/core/resize_observer';
import dateSerialization from '@js/core/utils/date_serialization';
import { contains } from '@js/core/utils/dom';
import { hasWindow } from '@js/core/utils/window';
import messageLocalization from '@js/localization/message';
Expand Down Expand Up @@ -302,8 +303,8 @@ class MessageList extends Widget<Properties> {
return false;
}

const lastMessageTimestampInMs = new Date(lastMessageTimestamp).getTime();
const newMessageTimestampInMs = new Date(newMessageTimestamp).getTime();
const lastMessageTimestampInMs = dateSerialization.deserializeDate(lastMessageTimestamp);
const newMessageTimestampInMs = dateSerialization.deserializeDate(newMessageTimestamp);

const result = newMessageTimestampInMs - lastMessageTimestampInMs > MESSAGEGROUP_TIMEOUT;

Expand Down

0 comments on commit bb5cf3d

Please sign in to comment.