Expand description
Timeline date bucketing — a faithful port of timeline-groups.ts.
Adapts the JS Date-based logic to chrono::Local. ymd takes 1-based
year/month/day ints (the JS ymd(new Date(...)) used 0-based months; our
API is 1-based and documented). format_date parses an RFC3339 string to
local time and formats it as YYYY-MM-DD, returning "" on null/invalid.
Structs§
- Timeline
Bucket - A timeline bucket: a label plus the points that fall under it.
Functions§
- bucket_
label - Bucket label for a single point relative to
now:"Working tree"for worktree points, else"Today"/"Yesterday"/"Earlier". - format_
date - Parse an RFC3339 string, convert to local time, format as
YYYY-MM-DD. Returns""forNoneor an unparseable value (parity with the JSnew Date(value)+ymd, which is local-timezone). - group_
timeline - Group points into ordered buckets by label, preserving first-seen order.
- ymd
- Zero-padded
YYYY-MM-DDfrom 1-based year/month/day.