From 52c1c7d440e0eb7669b7475b89dd79ea2f7c0405 Mon Sep 17 00:00:00 2001 From: Jonas Simoen Date: Thu, 18 Jan 2024 21:07:21 +0100 Subject: [PATCH] fix(stats): right calulation on played time --- src/controllers/Statistic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/Statistic.ts b/src/controllers/Statistic.ts index 52e640b..df75c90 100644 --- a/src/controllers/Statistic.ts +++ b/src/controllers/Statistic.ts @@ -130,7 +130,7 @@ export const PutMatchStatisticHandler = async (req: any, rep: any) => { return ({ ...stat, clubId: player!.clubId, - minutesPlayed: Math.min((stat.out - stat.in) || 0, 90), + minutesPlayed: Math.min(90, stat.out) - stat.in || 0, calculatedPoints, }) });