Dates.Recurring
Dates.Recurring copied to clipboard
Unify behavior
The DaysBuilder has Including() which takes one or more days, The WeekBuilder has OnDays() taking the same parameter. Both are optional. I like to have something like that for the MonthBuilder as well. Since OnDays better conveys the meaning I suggest doing OnDays() there as well so it aligns with the WeeksBuilder.
Apart from that it would be nice to have OnOrdinalWeek() and OnDay() working the same way as Including/OnDays(), so, optional, and making the parameters flags.
I dont know why this is different than days/months because having a 1st & 2nd week of a month does not equal having a 3rd week like the test has now.
So for non-breaking changes I suggest:
- Add OnDays() to MonthBuilder (optional but accepting flags)
- Make OnOrdinalWeek() and OnDay() optional (and omitting it would mean all weeks/days)
- Add OnWeeks() to MonthBuilder (optional but accepting flags)
Then a breaking change would be:
- Change Include() to OnDays() in the DaysBuilder (Thats just for semantics)
- Remove OnOrdinalWeek() and OnDay() because that functionality would be covered with the new OnWeeks() and OnDays()
Would you accept a PR for this, and if so is it ok to do the breaking changes?
Hi @Jogai,
Apologies for my delayed response, I like all your ideas and would accept a PR along these lines if you raised one.