File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/main/java/net/markwalder/tools/worktime/db Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 2121
2222public class WorkContract {
2323
24- private static final int WORK_MINUTES_PER_DAY = 504 ; // 8.4 h
25-
2624 /**
2725 * Get work time in minutes.
2826 */
@@ -39,16 +37,23 @@ public int getWorkTime(LocalDate date, Database database) {
3937 int dayOfYear = date .getDayOfYear ();
4038 int slot = (dayOfYear - 1 ) * 2 ;
4139
40+ int minutesPerDay = 42 * 60 / 5 ; // 8.4 h = 504 min
41+
42+ // from 2026-01-01 on, only 40 hours work week (8 h per day)
43+ if (date .isAfter (LocalDate .of (2025 , 12 , 31 ))) {
44+ minutesPerDay = 40 * 60 / 5 ; // 8 h = 480 min
45+ }
46+
4247 // morning
4348 byte value = workYear .getValue (slot );
4449 if (value == 0 ) { // no holiday, no vacation, ...
45- time += WORK_MINUTES_PER_DAY / 2 ;
50+ time += minutesPerDay / 2 ;
4651 }
4752
4853 // afternoon
4954 value = workYear .getValue (slot + 1 );
5055 if (value == 0 ) { // no holiday, no vacation, ...
51- time += WORK_MINUTES_PER_DAY / 2 ;
56+ time += minutesPerDay / 2 ;
5257 }
5358
5459 // from 2021-06-01 on, count only 80% for every day
You can’t perform that action at this time.
0 commit comments