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:
- Updating DayOfMonthTrigger to have a new data member "Date Type" with select choices "Variable Date" or "Specific Date".
- 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.
- The "Variable Date" choice will hide Trigger Days configuration and instead show "Nth Weekday", a value between 1-5 inclusive, and Weekday (Mon-Sun).
- 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.
- 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