Fix get time on non date var (#14361)
This commit is contained in:
+4
-1
@@ -1,3 +1,5 @@
|
||||
import { transpileToDateIfNot } from 'src/utils/transpile-to-date-if-not.util';
|
||||
|
||||
export const filterMorphRelationDuplicateFields = <
|
||||
T extends { createdAt: Date; morphId: string | null },
|
||||
>(
|
||||
@@ -7,7 +9,8 @@ export const filterMorphRelationDuplicateFields = <
|
||||
return !fields.some(
|
||||
(otherField) =>
|
||||
otherField.morphId === currentField.morphId &&
|
||||
otherField.createdAt.getTime() > currentField.createdAt.getTime(),
|
||||
transpileToDateIfNot(otherField.createdAt).getTime() >
|
||||
transpileToDateIfNot(currentField.createdAt).getTime(),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user