diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2023-10-01 15:55:12 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2023-10-01 15:55:12 +0700 |
commit | 056c8a1e3f3df248e767b4c57d53519d229da6f7 (patch) | |
tree | e09317f4f9d67e3b2b8a551b5013b4de55843f12 /src | |
parent | 5789fb4c158ec12702cc2e4b34611c791d2f527d (diff) |
fix segment with 0 hours
Diffstat (limited to 'src')
-rw-r--r-- | src/Result.jsx | 3 |
1 files changed, 2 insertions, 1 deletions
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; |