diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2023-10-01 15:46:19 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2023-10-01 15:46:19 +0700 |
commit | 5789fb4c158ec12702cc2e4b34611c791d2f527d (patch) | |
tree | 769055bd9e214d60c7477bb37cf4d74b35c85007 /src | |
parent | 8cc720288166a9bfe4892549510f869d83cc4127 (diff) |
fix segment pattern
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 e79ba7f..e361fc7 100644 --- a/src/Result.jsx +++ b/src/Result.jsx @@ -83,7 +83,8 @@ function calculatePerDay(entry, baseSalary) { ] } - const segmentedDuration = segmentTime(overtimeDuration, [1]); + const segmentPattern = weekendDay(entry.date) ? [8, 1, 15] : [1]; + 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]; |