-
Notifications
You must be signed in to change notification settings - Fork 26
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
Static Recurrence HolidayCollection #3
Comments
Hi Eric, I made Everything builds, demos, doc examples, and version numbers updated. Let me know your thoughts and/or recommendations. I'd be happy to send you the changes if you approve. I think the changes I made might be a good tradeoff to keep the same static behavior of Thanks, |
The problem is that your changes are a significant breaking change. I would much prefer to see an additional It minimizes the changes to just the It may be odd to have both a static and instance based property for holidays but it's been static for over a decade and I'd rather not force rewriting all existing code to handle one specific use-case. |
Hi Eric, I understand your concerns. Thanks for letting me know your thoughts. I would agree also, it is odd and confusing to have two kinds of holiday properties. I think having both static + non-static could also encourage new users to mistakenly use holidays properties and end up with weird date/time calculations for the API user. 😿 What should we do if both are used? Should we add exception guards that only allow one (static or non-static, but not both) holidays to avoid confusing situations? Thanks, |
Hey Eric, I started over and I run into
How are we going to present the semantics to the API end user? Should we duplicate this property too? Many thanks, |
Hi Eric, I think I got us out of the The changes should not be breaking changes I think. Let me know. Thanks, |
Rereading your original post I see that what you are trying to do is effectively exclude an arbitrary set of dates, not necessarily holidays. I missed that yesterday and got focused on the holiday collection. Sorry about that. All things considered, a simple ExcludedDates property of the type public IEnumerable<DateTime> ExcludedDates { get; set; }
if(this.ExcludedDates != null && this.ExcludedDates.Contains(rdt.ToDateTime().Date))
{
rdtc.RemoveAt(idx);
idx--;
count--;
continue;
} If you needed to include times you could probably add a Boolean property that indicates whether or not the |
Hi Eric, Thanks for your guidance. It's really helpful. My specific problem domain with excluded dates is, they work exactly like In your suggestion, it seems more like PDI would more work with fixed excluded dates only? Would I have to resolve these Let me know your thoughts. Thanks, |
If you know the years between which you are generating recurrence dates, you can generate all of the possible dates using the holiday collection ( The On a similar note, I'd remove line 440 in the Eric |
Hi Eric, Thanks again for your feedback. I think https://github.com/bchavez/PDI/commit/708f22e2d0aaf217b75859b75bbbee4f2c922ee6 Thanks, |
It looks good. Submit a pull request and I'll merge the changes. |
Hi Eric,
Thanks again for open-sourcing PDI.
I'm trying to use
Recurrence
for some date calculations, but I have a situation where I need to maintain two sets of "holidays" (basically using it as an exclusion list of dates) for recurrence calculations.Would you consider making
HolidayCollection holidays
inRecurrence
non-static so different instances ofRecurrence
can use differentHolidayCollection
s?Another alternative is to have a
Recurrence.ExcludeCollection
that works similarly toHolidayCollection
? Let me know your thoughts. I'd be more than happy to send you a pull-request.Thanks,
Brian
The text was updated successfully, but these errors were encountered: