Skip to main content

parse_recurrence_id

Function parse_recurrence_id 

Source
pub fn parse_recurrence_id(
    raw: &str,
    on_dropped: impl FnMut(&str),
) -> Option<String>
Expand description

The occurrence a RECURRENCE_ID value names: a date, optionally followed by a clock time.

Returns the value normalised (YYYY-MM-DD or YYYY-MM-DD HH:MM), or None when the date does not parse. Anything after the date that is not a time is dropped and the date kept: the date is what the resolver matches on, and losing the exception over a stray word would be the worse failure. What was dropped is handed to on_dropped rather than passed over in silence – it is text the file wrote and this value no longer carries, and an export built from the field will not carry it either.