Skip to main content

Module due

Module due 

Source
Expand description

Minimal due-date parsing and rendering.

Accepts the common forms a personal task manager needs:

  • today, tomorrow
  • weekday names: fri, friday, next monday (next future occurrence)
  • relative offsets: +3d, 3d, +1w, 2w (added to today)
  • YYYY-MM-DD (ISO 8601 calendar date)
  • MM-DD (current year implied)
  • DD.MM (German short form, current year implied)
  • DD.MM.YYYY (German long form)

Weekday names always resolve to the next matching day in the future, never today (so friday on a Friday means the following Friday); the optional next prefix is accepted as a synonym. The parser returns a structured error for anything it does not recognise so the CLI can surface a useful hint. See JOT-0032-69.

Rendering produces short human-readable labels for a list view, with a side-channel severity so the CLI can colorise consistently.

Structs§

ParseDueError

Enums§

DueSeverity
Relative severity of a due date compared to ‘today’.
LabelMode
Label length mode. Long is the default reader-friendly form (today, tomorrow, overdue 2d); Short compresses to the terminal-friendly abbreviations matching joy-cli short mode (tod, tmw, -2d). Weekday and month-day renderings are the same in both modes because %a and %b %-d are already compact.

Functions§

parse_due
Parse a --due argument against a reference ‘today’ date.
render_due
Render a due date as a label. Returns (label, severity) so the CLI can apply colors consistently.