Skip to main content

extract_clocks

Function extract_clocks 

Source
pub fn extract_clocks(text: &str) -> Vec<ClockEntry>
Expand description

Extract all CLOCK entries from text.

Two forms are recognized:

  • Closed: CLOCK: [start]--[end] => HH:MM — yields all three fields filled (start, Some(end), Some(duration)).
  • Open: CLOCK: [start] — represents an in-progress interval that has not yet been closed; yields start only with end = None and duration = None.

The duration tail (=> HH:MM) is optional even on closed clocks; org-mode inserts it automatically but does not require it for the line to parse.