12345678 |
- import { WrappedMessage } from "../../interfaces/general.interface";
- export function sortMessageBasedOnDate(array: WrappedMessage[]): WrappedMessage[] {
- console.log(`Sorting ${array.length} messages....`)
- return array.sort((a, b) => {
- return new Date(a.timeReceived).getTime() - new Date(b.timeReceived).getTime();
- });
- }
|