Skip to content

Improvement: ScheduledExecution DayOfMonthTrigger - allow variable day of month (first saturday, second monday, etc.) #145

@william-deeken

Description

@william-deeken

Allow users to set a DayOfMonthTrigger that specifies the first, second, third, etc. day of week (monday, tuesday, etc.) instead of just a static date.

Changes would include:

  1. Updating DayOfMonthTrigger to have a new data member "Date Type" with select choices "Variable Date" or "Specific Date".
  2. The "Specific Date" selection would cause this trigger configuration to behave as is currently does. User has the ability to choose Trigger Days and Trigger Times.
  3. The "Variable Date" choice will hide Trigger Days configuration and instead show "Nth Weekday", a value between 1-5 inclusive, and Weekday (Mon-Sun).
  4. New methods DayOfMonthTrigger.GetVariableDateOfMonth, DayOfMonthTrigger.GetNextMonthWithValidVariableDate to handle getting the current month's next run time and the next valid runtime after the current month.
  5. Update existing methods for new trigger type.

This was needed internally, so the code updates/tests have already been completed, but I figured I'd bring it up as an issue in case the maintainers thought it was something worthy to include in the public release, and then I can initiate a pull request.

repo: https://github.com/william-deeken/VAF.Extensions.Community/tree/Schedule_VariableDayOfMonth

The attached spreadsheet includes all the new test cases I devised for the various methods. These test cases have all been added to the MFiles.VAF.Extensions.Tests project.

VariableDate_TestCases.xlsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions