working compound days + working public holidays
Some checks failed
Tests / Run Go Tests (push) Failing after 44s
Some checks failed
Tests / Run Go Tests (push) Failing after 44s
This commit is contained in:
@@ -14,6 +14,11 @@ type PublicHoliday struct {
|
||||
worktime int8
|
||||
}
|
||||
|
||||
// IsEmpty implements [IWorkDay].
|
||||
func (p *PublicHoliday) IsEmpty() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func NewHolidayFromFeiertag(f feiertage.Feiertag) PublicHoliday {
|
||||
return PublicHoliday{
|
||||
Feiertag: f,
|
||||
@@ -106,9 +111,9 @@ func (p *PublicHoliday) RequiresAction() bool {
|
||||
func (p *PublicHoliday) GetWorktime(u User, base WorktimeBase, includeKurzarbeit bool) time.Duration {
|
||||
switch base {
|
||||
case WorktimeBaseDay:
|
||||
return u.ArbeitszeitProTagFrac(float32(p.worktime / 100))
|
||||
return u.ArbeitszeitProTagFrac(float32(p.worktime) / 100)
|
||||
case WorktimeBaseWeek:
|
||||
return u.ArbeitszeitProWocheFrac(float32(p.worktime/100) * 0.2)
|
||||
return u.ArbeitszeitProWocheFrac(float32(p.worktime) / 500)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user