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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user