diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-08-25 14:19:52 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-08-25 14:19:52 +0200 |
| commit | 218ac55d86ee49d151c0ba2dfbca6da104c66703 (patch) | |
| tree | 1b6546436f71b23c04d4930e46836c9614452abf /overlays/worktime | |
| parent | 13000ec4703d1dd49fd12f8c2cb427130e4899b7 (diff) | |
| download | nixos-218ac55d86ee49d151c0ba2dfbca6da104c66703.tar nixos-218ac55d86ee49d151c0ba2dfbca6da104c66703.tar.gz nixos-218ac55d86ee49d151c0ba2dfbca6da104c66703.tar.bz2 nixos-218ac55d86ee49d151c0ba2dfbca6da104c66703.tar.xz nixos-218ac55d86ee49d151c0ba2dfbca6da104c66703.zip | |
...
Diffstat (limited to 'overlays/worktime')
| -rwxr-xr-x | overlays/worktime/worktime/__main__.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py index 3e7aeb9f..016690f0 100755 --- a/overlays/worktime/worktime/__main__.py +++ b/overlays/worktime/worktime/__main__.py | |||
| @@ -375,10 +375,7 @@ class Worktime(object): | |||
| 375 | parse_datestr(stripped_line) | 375 | parse_datestr(stripped_line) |
| 376 | 376 | ||
| 377 | for day in [fromDay + timedelta(days = x) for x in range(0, (toDay - fromDay).days + 1)]: | 377 | for day in [fromDay + timedelta(days = x) for x in range(0, (toDay - fromDay).days + 1)]: |
| 378 | # if self.end_date.date() < day or day < self.start_date.date(): | 378 | if self.would_be_workday(day) and self.start_date.date() <= day and day <= self.end_date.date(): |
| 379 | # continue | ||
| 380 | |||
| 381 | if self.would_be_workday(day): | ||
| 382 | if excused_kind == 'leave': | 379 | if excused_kind == 'leave': |
| 383 | self.leave_days.add(day) | 380 | self.leave_days.add(day) |
| 384 | elif time is not None and time >= self.time_per_day(day): | 381 | elif time is not None and time >= self.time_per_day(day): |
| @@ -444,8 +441,9 @@ class Worktime(object): | |||
| 444 | if e.errno != 2: | 441 | if e.errno != 2: |
| 445 | raise e | 442 | raise e |
| 446 | 443 | ||
| 447 | for year in range(self.end_date.year + 1, max(self.pull_forward.keys()).year + 1): | 444 | if self.pull_forward: |
| 448 | holidays |= {k: v * timedelta(hours = hours_per_week(k)) / len(self.workdays) for k, v in Worktime.holidays(year).items()} | 445 | for year in range(self.end_date.year + 1, max(self.pull_forward.keys()).year + 1): |
| 446 | holidays |= {k: v * timedelta(hours = hours_per_week(k)) / len(self.workdays) for k, v in Worktime.holidays(year).items()} | ||
| 449 | 447 | ||
| 450 | self.days_to_work = dict() | 448 | self.days_to_work = dict() |
| 451 | 449 | ||
