mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-26 05:08:06 +00:00
Fix UI for invalid timestamps
This commit is contained in:
@@ -206,3 +206,10 @@ export function formatDate(
|
||||
year: 'numeric',
|
||||
});
|
||||
}
|
||||
|
||||
const MAX_SAFE_DATE = 8640000000000000;
|
||||
const MIN_SAFE_DATE = -8640000000000000;
|
||||
|
||||
export function toBoundedDate(timestamp: number): Date {
|
||||
return new Date(Math.max(MIN_SAFE_DATE, Math.min(timestamp, MAX_SAFE_DATE)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user