Skip to content

Commit

Permalink
Fix Fortnightly schedule cleanup check is cheking for weekday
Browse files Browse the repository at this point in the history
  • Loading branch information
sworup committed Jan 25, 2023
1 parent 57594b7 commit 995ef81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/datasource/schedule_with_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (schedule *Schedule) UpdateNextReportTime() {
reportTime = reportTime.AddDate(0, 1, daysOffset)
}
case 2: // fortnightly
if scheduleDays == int(reportTime.Weekday()) {
if scheduleDays == int(reportTime.Day()) {
reportTime = reportTime.AddDate(0, 0, 14)
} else {
daysToAdd := (scheduleDays - int(reportTime.Day()) + 14) % 14
Expand Down

0 comments on commit 995ef81

Please sign in to comment.