feat: support safe recurrence additions

Parse, persist, expand, and round-trip compatible RDATE values while preserving whole-series TUI behavior and conservative rewrite guards.

Verified: normal, warning-as-error, and ASan/UBSan builds pass all 9 suites; storage failure paths preserve calendar and backup bytes; live PTY restores terminal state.
This commit is contained in:
2026-07-18 10:14:53 +01:00
parent 989332ef9a
commit cfca6ab6d0
16 changed files with 498 additions and 69 deletions

View File

@@ -39,6 +39,7 @@ struct Event {
TimeBasis time_basis{TimeBasis::utc};
std::string time_zone;
std::optional<RecurrenceRule> recurrence;
std::vector<TimePoint> recurrence_additions;
std::vector<TimePoint> recurrence_exceptions;
};
@@ -55,4 +56,9 @@ struct Calendar {
return event.end >= event.start;
}
[[nodiscard]] constexpr bool is_recurring(const Event& event) noexcept
{
return event.recurrence.has_value() || !event.recurrence_additions.empty();
}
} // namespace nocal