Skip to content

Commit f80544b

Browse files
committed
Change: Upgrade work contract starting 2026-01-01.
1 parent 86c0ca7 commit f80544b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main/java/net/markwalder/tools/worktime/db/WorkContract.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
public 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

0 commit comments

Comments
 (0)