Files
letro-authentication-service/frontend/src/utils/dates.ts
Quentin Gliech 9a946c19e7 Remove (C)
2024-09-10 14:28:55 +02:00

14 lines
522 B
TypeScript

// Copyright 2024 New Vector Ltd.
// Copyright 2024 The Matrix.org Foundation C.I.C.
//
// SPDX-License-Identifier: AGPL-3.0-only
// Please see LICENSE in the repository root for full details.
/** Compute what the date was 90 days ago, rouding down to the start of the day */
export const getNinetyDaysAgo = (): string => {
const date = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000);
// Round down to the start of the day to avoid rerendering/requerying
date.setHours(0, 0, 0, 0);
return date.toISOString();
};