Map<String, dynamic> toJson() => { 'frequency': frequency?.index, 'occurrences': occurrences, 'endDate': endDate?.millisecondsSinceEpoch, 'interval': interval, 'rRule': rRule, };