Expand description
Parse natural-language dates and times (English + Russian) into jiff types.
use jiff::Zoned;
use whenparse::{parse_with, When};
let now = Zoned::now();
assert!(matches!(parse_with("next friday", &now), Ok(When::Date(_))));
assert!(matches!(parse_with("через 2 недели", &now), Ok(When::Date(_))));
assert!(matches!(parse_with("2h30m", &now), Ok(When::Duration(_))));Structs§
Enums§
Functions§
- parse
- Parse
inputrelative to the anchornow. The anchor is always explicit so results are deterministic and testable. - parse_
with - Convenience wrapper over
parsewith defaultOptions.