From 056c8a1e3f3df248e767b4c57d53519d229da6f7 Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Sun, 1 Oct 2023 15:55:12 +0700 Subject: fix segment with 0 hours --- src/Result.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Result.jsx b/src/Result.jsx index e361fc7..dbb5507 100644 --- a/src/Result.jsx +++ b/src/Result.jsx @@ -87,7 +87,8 @@ function calculatePerDay(entry, baseSalary) { const segmentedDuration = segmentTime(overtimeDuration, segmentPattern); const usedMap = weekendDay(entry.date) ? multiplierMap.holidays : multiplierMap.workDays; for (let i = 0; i < segmentedDuration.length; i++) { - multiplier += segmentedDuration[i] * usedMap[i]; + if (segmentedDuration[i]) + multiplier += segmentedDuration[i] * usedMap[i]; } return multiplier * hourlyPay; -- cgit v1.2.3-70-g09d2