diff --git a/apps/meteor/client/lib/lists/RecordList.ts b/apps/meteor/client/lib/lists/RecordList.ts index a59156b531e2..d4f802f3267b 100644 --- a/apps/meteor/client/lib/lists/RecordList.ts +++ b/apps/meteor/client/lib/lists/RecordList.ts @@ -23,7 +23,9 @@ export class RecordList extends Em } protected compare(a: T, b: T): number { - return (b._updatedAt?.getTime() ?? -1) - (a._updatedAt?.getTime() ?? -1); + const aUpdatedAt = typeof a._updatedAt === 'string' ? new Date(a._updatedAt) : a._updatedAt; + const bUpdatedAt = typeof b._updatedAt === 'string' ? new Date(b._updatedAt) : b._updatedAt; + return (bUpdatedAt?.getTime() ?? -1) - (aUpdatedAt?.getTime() ?? -1); } public get phase(): AsyncStatePhase {