From 2fb1c4bb1175543b768ae5d6d39e319430f67fb8 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Tue, 31 May 2022 09:51:44 -0600 Subject: [PATCH] Free markets: Generate new date for setUTCHours --- functions/src/create-contract.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/src/create-contract.ts b/functions/src/create-contract.ts index e30ba608..ab65180b 100644 --- a/functions/src/create-contract.ts +++ b/functions/src/create-contract.ts @@ -69,7 +69,7 @@ export const createContract = newEndpoint(['POST'], async (req, [user, _]) => { // Uses utc time on server: const today = new Date() - let freeMarketResetTime = today.setUTCHours(16, 0, 0, 0) + let freeMarketResetTime = new Date().setUTCHours(16, 0, 0, 0) if (today.getTime() < freeMarketResetTime) { freeMarketResetTime = freeMarketResetTime - 24 * 60 * 60 * 1000 }