mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 09:15:35 +03:00
10 lines
320 B
TypeScript
10 lines
320 B
TypeScript
|
|
export const isTenMinutesApart = (date1: string, date2: string): boolean => {
|
||
|
|
if (!date1 || !date2) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
const diffInMilliseconds = Math.abs(new Date(date1).getTime() - new Date(date2).getTime());
|
||
|
|
const minutesDifference = diffInMilliseconds / (1000 * 60);
|
||
|
|
|
||
|
|
return minutesDifference >= 10;
|
||
|
|
};
|