citum-edtf
A modern parser for the Extended Date/Time Format (ISO 8601-2:2019),
implementing EDTF Level 0 and Level 1. Built on
winnow for zero-allocation parsing.
Used by the Citum citation engine for date handling in bibliographic references, but has no Citum-specific dependencies — usable standalone for any project that needs EDTF date parsing.
Usage
The primary entry point is the FromStr impl on Edtf:
use Edtf;
FromStr consumes the entire string and returns a ParseError on failure.
For streaming or parser-combinator use cases where you need to consume only a
prefix and leave the rest in place, use the lower-level parse and
parse_date functions, which follow the
winnow &mut &str convention.
Supported syntax includes negative years, year precision, month/day
precision, approximations (~), uncertainty (?), unspecified digits (X),
intervals, seasons, and decade/century precision.
Project
Part of Citum, a modern citation engine in Rust.
License
Dual-licensed under MIT or Apache-2.0 at your option.