Replies: 3 comments 1 reply
-
@DaleyKD
ical.net/Ical.Net/Evaluation/Evaluator.cs Lines 62 to 64 in a0179f8 and RecurrencePattern contains comments for a fixed bugIs RRULE FREQ=SECONDLY on our todo list? |
Beta Was this translation helpful? Give feedback.
-
[Test]
public void SecondlyRecurrence()
{
var dateTime = DateTime.UtcNow;
// Create a new calendar
var calendar = new Calendar
{
RecurrenceRestriction = RecurrenceRestrictionType.NoRestriction
};
var calendarEvent = new CalendarEvent
{
Summary = "Recurring Event Every 45 Seconds",
DtStart = new CalDateTime(dateTime),
DtEnd = new CalDateTime(dateTime.AddHours(1)),
RecurrenceRules = new List<RecurrencePattern>
{
new RecurrencePattern(FrequencyType.Secondly, 45)
}
};
// Add the event to the calendar
calendar.Events.Add(calendarEvent);
// Serialize the calendar to an iCalendar string
var serializer = new CalendarSerializer();
var serializedCalendar = serializer.SerializeToString(calendar);
// Evaluate the recurrences
var occurrences = calendar.GetOccurrences(dateTime, dateTime.AddHours(1));
// or
// var occurrences = calendarEvent.GetOccurrences(dateTime, dateTime.AddHours(1));
Assert.That(occurrences, Has.Count.EqualTo(80));
} Serializes correctly:
Fails here when calling ical.net/Ical.Net/Evaluation/RecurrencePatternEvaluator.cs Lines 181 to 191 in a0179f8 because variable evaluationRestriction is RecurrenceRestrictionType.Default although set with RecurrenceRestrictionType.NoRestriction .
|
Beta Was this translation helpful? Give feedback.
-
Closed in favor of #622 |
Beta Was this translation helpful? Give feedback.
-
Does this library support getting occurrences if we use a secondly recurrence pattern?
Our project doesn't use this for calendar events, but more to help us determine when to run the next job (as part of our job scheduler). And SOME jobs need to run every 45 seconds or so.
I've been trying to get it to work, but have had no luck. It seems to work for FREQ=MINUTELY.
Beta Was this translation helpful? Give feedback.
All reactions