getRecurrenceDateTimeCollection static method
Returns the date time collection at which the recurrence appointment will recur
Using this method the recurrence appointments occurrence date time collection can be obtained.
- rRule - required - the recurrence rule of the appointment
- recurrenceStartDate - required - the start date in which the recurrence starts.
- specificStartDate - optional - the specific start date, used to get the date collection for a specific interval of dates.
- specificEndDate - optional - the specific end date, used to get the date collection for a specific interval of dates.
return List<DateTime>
See also:
- Appointment.recurrenceRule, to set the recurrence rule for the Appointment, which will recur based on the given rule.
- TimeRegion.recurrenceRule, to set the recurrence rule for the TimeRegion, which will recur based on the given rule.
- Knowledge base: How to get the recurrence date collection
DateTime dateTime = DateTime(2020, 03, 15);
List<DateTime> dateCollection =
SfCalendar.getRecurrenceDateTimeCollection(
'FREQ=DAILY;INTERVAL=1;COUNT=3', dateTime);
Implementation
static List<DateTime> getRecurrenceDateTimeCollection(
String rRule, DateTime recurrenceStartDate,
{DateTime? specificStartDate, DateTime? specificEndDate}) {
assert(specificStartDate == null ||
specificEndDate == null ||
CalendarViewHelper.isSameOrBeforeDateTime(
specificEndDate, specificStartDate));
assert(specificStartDate == null ||
specificEndDate == null ||
CalendarViewHelper.isSameOrAfterDateTime(
specificStartDate, specificEndDate));
return RecurrenceHelper.getRecurrenceDateTimeCollection(
rRule, recurrenceStartDate,
specificStartDate: specificStartDate, specificEndDate: specificEndDate);
}