Skip to content

Commit

Permalink
Merge pull request #156 from vshn/fix-tz-weekend
Browse files Browse the repository at this point in the history
Fix leave calculation if leave was on Monday in vancouver
  • Loading branch information
ccremer authored Dec 20, 2022
2 parents c54e308 + ead5a67 commit 182ef83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/timesheet/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (r *ReportBuilder) filterLeavesInTimeRange() []model.Leave {
tz := r.getTimeZone()
from := split.DateFrom
date := odoo.Midnight(from.In(tz))
if odoo.IsWithinTimeRange(date, r.from, r.to) && date.Weekday() != time.Sunday && date.Weekday() != time.Saturday {
if odoo.IsWithinTimeRange(date, r.from, r.to) {
split.DateFrom.Time = odoo.LocalizeTime(split.DateFrom.Time, tz)
split.DateTo.Time = odoo.LocalizeTime(split.DateTo.Time, tz)
filteredLeaves = append(filteredLeaves, split)
Expand Down

0 comments on commit 182ef83

Please sign in to comment.