implemented recurrence exception (EXDATE) support for custom events, refactored timetable break and holiday generation logic, and refined RRule editor UI/theming and tile layouts
This commit is contained in:
@@ -106,10 +106,21 @@ partitionAppointmentsForWeek(
|
||||
final parsed = RecurrenceRule.fromString(rule);
|
||||
final anchorUtc = a.startTime.toUtc();
|
||||
final duration = a.endTime.difference(a.startTime);
|
||||
// Day-keyed set of exception dates so occurrences scheduled for one
|
||||
// of them get skipped. Syncfusion's own recurrenceExceptionDates
|
||||
// handling never runs because we expand the rule manually here.
|
||||
final exceptionDayKeys = (a.recurrenceExceptionDates ?? const <DateTime>[])
|
||||
.map((d) => '${d.year}-${d.month}-${d.day}')
|
||||
.toSet();
|
||||
for (final occUtc in parsed.getInstances(start: anchorUtc)) {
|
||||
if (!occUtc.isBefore(weekEndUtc)) break;
|
||||
if (occUtc.isBefore(weekStartUtc)) continue;
|
||||
final occLocal = occUtc.toLocal();
|
||||
if (exceptionDayKeys.contains(
|
||||
'${occLocal.year}-${occLocal.month}-${occLocal.day}',
|
||||
)) {
|
||||
continue;
|
||||
}
|
||||
final idx = DateTime(
|
||||
occLocal.year,
|
||||
occLocal.month,
|
||||
|
||||
Reference in New Issue
Block a user