From 5789fb4c158ec12702cc2e4b34611c791d2f527d Mon Sep 17 00:00:00 2001
From: Rosyid Haryadi <rosyid_haryadi@protonmail.com>
Date: Sun, 1 Oct 2023 15:46:19 +0700
Subject: fix segment pattern

---
 src/Result.jsx | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/Result.jsx')

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];
-- 
cgit v1.2.3-70-g09d2

