问题
is there a free recurrence library that is available that we could use ?, we are looking for something like we supply the date time and the type of recurrence (daily, Monthly, Weekly and the interval(say for every 2 weeks or months or days) and we get a list of future dates ???
Thanks Nen
回答1:
I am using dday-ical at sourceforge for recurrence calculations.
Beside loading and and saveing ical files it can interpretete calendar-recurrencerules a la
every 4th friday in every month but not on xmas
Have a look at mozilla-calendar (sunbird) or microsoft outlook to see how complex recurrence dates can be.
Update:
The project has moved to https://github.com/rianjs/ical.net and is available using Nuget: iCal.Net
回答2:
Take a look at Itinerary. It does exactly this.
Disclosure: I'm the project maintainer.
回答3:
Aspose.iCalendar, which is part of their Aspose.Network product, seems to have what you want:
//Ten team meetings, every Monday at 10am.
RecurrencePattern pattern = new RecurrencePattern(
"DTSTART:20040301T100000\n" +
"RRULE:FREQ=WEEKLY;COUNT=10;BYDAY=MO");
DateArray dates = pattern.GenerateOccurrences();
However, buying Aspose.Network just for that functionality is probably overkill.
回答4:
You might want to read this blog post by Jon Skeet on the subject, referring to the Noda Time library.
来源:https://stackoverflow.com/questions/4517376/recurrence-library-for-date-calculations-for-net