From 4b85b2ba34a8f7a1af25cfccc450f7f522d89d6f Mon Sep 17 00:00:00 2001 From: Aleksei Simatov Date: Tue, 7 Jan 2025 23:06:49 +0700 Subject: [PATCH] Feature: Fix time calculation --- build/index.js | 3 ++- src/converters/utils/prepareResponseTime.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/index.js b/build/index.js index c902bca..041757a 100644 --- a/build/index.js +++ b/build/index.js @@ -1587,7 +1587,8 @@ const prepareResponseTime = (events = [], pullRequest, collection, dateKey, team .map((element) => (0, calculations_1.calcDifferenceInMinutes)(element?.[0], element?.[1], { endOfWorkingTime: (0, utils_1.getValueAsIs)("CORE_HOURS_END"), startOfWorkingTime: (0, utils_1.getValueAsIs)("CORE_HOURS_START"), - }, (0, utils_1.getMultipleValuesInput)("HOLIDAYS"))); + }, (0, utils_1.getMultipleValuesInput)("HOLIDAYS"))) + .filter((el) => typeof el === "number"); (0, set_1.default)(collection, [userKey, key, "timeWaitingForRepeatedReview"], [ ...(0, get_1.default)(collection, [userKey, key, "timeWaitingForRepeatedReview"], []), ...awaitingResponse, diff --git a/src/converters/utils/prepareResponseTime.ts b/src/converters/utils/prepareResponseTime.ts index 30e7456..f9fe03d 100644 --- a/src/converters/utils/prepareResponseTime.ts +++ b/src/converters/utils/prepareResponseTime.ts @@ -38,12 +38,17 @@ export const prepareResponseTime = ( }, getMultipleValuesInput("HOLIDAYS") ) - ); + ) + .filter((el) => typeof el === "number") as number[]; set( collection, [userKey, key, "timeWaitingForRepeatedReview"], [ - ...get(collection, [userKey, key, "timeWaitingForRepeatedReview"], []), + ...get( + collection, + [userKey, key, "timeWaitingForRepeatedReview"], + [] + ), ...awaitingResponse, ] );