fix: Streamlines event scheduler API. Adds months to weekly recurrence (#2178)

This commit is contained in:
Kamron Batman 2025-05-07 22:42:44 -07:00 • committed by GitHub
parent 990e86b983
commit f95b3a8b3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 347 additions and 137 deletions

View file

@ -7,27 +7,23 @@ public class YearlyCallbackScheduledEvent : YearlyScheduledEvent
private readonly Action _callback;
protected YearlyCallbackScheduledEvent(
DateTime startAfter,
TimeOnly time,
MonthDay yearlyStart,
MonthDay yearlyEnd,
Action callback,
IRecurrencePattern recurrence,
TimeZoneInfo timeZone = null
) : this(startAfter, DateTime.MaxValue, time, yearlyStart, yearlyEnd, callback, recurrence, timeZone)
IRecurrencePattern recurrence
) : this(time, yearlyStart, yearlyEnd, DateTime.MaxValue, callback, recurrence)
{
}
protected YearlyCallbackScheduledEvent(
DateTime startAfter,
DateTime endOn,
TimeOnly time,
MonthDay yearlyStart,
MonthDay yearlyEnd,
DateTime endOn,
Action callback,
IRecurrencePattern recurrence,
TimeZoneInfo timeZone = null
) : base(startAfter, endOn, time, yearlyStart, yearlyEnd, recurrence, timeZone) => _callback = callback;
IRecurrencePattern recurrence
) : base(time, yearlyStart, yearlyEnd, endOn, recurrence) => _callback = callback;
public override void OnEvent() => _callback();
}