fdate/lib.rs
1//! _Fdate_ is a library for searching relative dates in English. It attempts to
2//! be simple and unambigious yet provides a bit of flexibility with
3//! configuration.
4
5mod parser;
6mod util;
7
8use chrono::NaiveDate;
9pub use parser::{FirstDay, Parser, ParserConfig};
10
11/// Returns a date on successful parsing with defaults applied:
12/// 1. Week starts with Monday,
13/// 2. Calls for [chrono::Local::now],
14/// 3. `next` and `last` mean the closest but today, e. g. `next Wednesday` will
15/// mean tomorrow if today is Tuesday.
16pub fn parse(input: &str) -> Option<NaiveDate> {
17 Parser::new().parse(input)
18}