ExLedger.Parser.Timeclock (ex_ledger v0.6.1)
Parses and reports on timeclock entries.
Timeclock entries use the format: i YYYY/MM/DD HH:MM:SS ACCOUNT [PAYEE] ; check-in o YYYY/MM/DD HH:MM:SS ; check-out (lowercase) O YYYY/MM/DD HH:MM:SS ; check-out cleared (uppercase)
Summary
Functions
Formats a timeclock report as a string.
Parses timeclock entries from input text.
Aggregates timeclock entries by account and returns total hours.
Types
@type time_entry() :: %{ account: String.t(), start: NaiveDateTime.t(), stop: NaiveDateTime.t(), payee: String.t() | nil, cleared: boolean(), duration_seconds: non_neg_integer() }
Functions
Formats a timeclock report as a string.
@spec parse_timeclock_entries(String.t()) :: [time_entry()]
Parses timeclock entries from input text.
Returns a list of completed time entries (check-in paired with check-out). Warns to stderr about any unclosed check-ins.
@spec timeclock_report([time_entry()]) :: %{required(String.t()) => float()}
Aggregates timeclock entries by account and returns total hours.