From a7ae495e37223ee60e8ad7e297a36bb91d8ce793 Mon Sep 17 00:00:00 2001 From: Nareshkumar Rao Date: Thu, 5 Aug 2021 21:14:51 +0200 Subject: [PATCH] date issue fix --- src/db/models/User.helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/models/User.helper.ts b/src/db/models/User.helper.ts index 342522d..e90bcdd 100644 --- a/src/db/models/User.helper.ts +++ b/src/db/models/User.helper.ts @@ -55,8 +55,8 @@ export function getUserByVerification( export function getUserCovidPositivity(telegramID: TelegramID, callback: (isInfected?: boolean) => void): void { getUserByTelegramID(telegramID, user => { if (!!user) { - const infectionDuration = +user.infectionDate - Date.now(); - if (infectionDuration > 60 * 60 * 24 * 14) { + const infectionDuration = Date.now() - +user.infectionDate; + if (infectionDuration > 60 * 60 * 24 * 14 * 1000) { setUserCovidPositivity(telegramID, false, success => { callback(success ? false : undefined); });