teno_rrule 0.0.5 copy "teno_rrule: ^0.0.5" to clipboard
teno_rrule: ^0.0.5 copied to clipboard

Dart Recurrence Rule library that implements RFC5545 (iCalendar), support timezone (TZDateTime), week start (WKST), exclusion (EXDATES),...

example/teno_rrule_example.dart

import 'package:teno_rrule/teno_rrule.dart';
import 'package:timezone/data/latest_10y.dart';

void main() {
  initializeTimeZones();

  // Create rrule instance programmatically
  final rrule = RecurrenceRule(
      frequency: Frequency.weekly,
      startDate: DateTime(1997, 9, 2, 9),
      byWeekDays: {WeekDay.monday, WeekDay.wednesday, WeekDay.friday});
  for (var instance
      in rrule.between(DateTime(1997, 9, 2, 9), DateTime(1997, 10, 2, 9))) {
    print(instance);
  }

  // Parse from string
  final rruleString = 'DTSTART;TZID=America/New_York:19970902T090000\n'
      'RRULE:FREQ=DAILY;INTERVAL=2';
  final rruleFromString = RecurrenceRule.from(rruleString);

  // Get all instances
  // if there is no UNTIL nor COUNT, then this will return all instances before 2100-12-31
  print(rruleFromString!.allInstances);
}
4
likes
140
pub points
50%
popularity

Publisher

verified publishertenolife.com

Dart Recurrence Rule library that implements RFC5545 (iCalendar), support timezone (TZDateTime), week start (WKST), exclusion (EXDATES),...

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

equatable, teno_datetime, timezone

More

Packages that depend on teno_rrule