Apply bounds to timestamps during backup import
This commit is contained in:
parent
8c57d243c0
commit
69ac276d0c
6 changed files with 172 additions and 45 deletions
|
@ -207,8 +207,8 @@ export function formatDate(
|
|||
});
|
||||
}
|
||||
|
||||
const MAX_SAFE_DATE = 8640000000000000;
|
||||
const MIN_SAFE_DATE = -8640000000000000;
|
||||
export const MAX_SAFE_DATE = 8640000000000000;
|
||||
export 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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue