Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For Cron Expressions, split the DayOfWeek and DayOfMonth #318

Closed
Badgerati opened this issue Aug 2, 2019 · 1 comment · Fixed by #329
Closed

For Cron Expressions, split the DayOfWeek and DayOfMonth #318

Badgerati opened this issue Aug 2, 2019 · 1 comment · Fixed by #329
Assignees
Labels
Milestone

Comments

@Badgerati
Copy link
Owner

The Day of the Week and Day of the Month checks should be split up - to allow for expressions that run on specific days of the month without caring about the current day.

From:

# check day of week and day of month (both must fail)
if (!(Test-RangeAndValue -AtomContraint $Expression.DayOfWeek -NowValue ([int]$DateTime.DayOfWeek)) -and
    !(Test-RangeAndValue -AtomContraint $Expression.DayOfMonth -NowValue $DateTime.Day)) {
    return $false
}

To:

# check day of month
if (!(Test-RangeAndValue -AtomContraint $Expression.DayOfMonth -NowValue $DateTime.Day)) {
    return $false
}

# check day of week
if (!(Test-RangeAndValue -AtomContraint $Expression.DayOfWeek -NowValue ([int]$DateTime.DayOfWeek))) {
    return $false
}

Also, @quaterly should be spelled correctly: @quarterly

@Badgerati Badgerati added this to the 1.0.0 milestone Aug 2, 2019
@Badgerati
Copy link
Owner Author

Also, fix:

'@quarterly' = '0 0 1 1,4,7,10';
'@semidaily' = '0 0,12 * * *';

@Badgerati Badgerati self-assigned this Aug 9, 2019
Badgerati added a commit that referenced this issue Aug 10, 2019
#318: Fix cron expressions for quarterly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant