diff --git a/src/db/models/User.helper.ts b/src/db/models/User.helper.ts index baf7909..7e6bb8c 100644 --- a/src/db/models/User.helper.ts +++ b/src/db/models/User.helper.ts @@ -39,7 +39,7 @@ export async function getUserCovidPositivity( ): Promise { const user = await getUserByTelegramID(telegramID); if (!user) throw new Error("User not found"); - const infectionDuration = Date.now() - +user.infectionDate; + const infectionDuration = new Date().getTime() - user.infectionDate.getTime(); if (infectionDuration > 60 * 60 * 24 * 14 * 1000) { await setUserCovidPositivity(telegramID, false); return false;