fn preprocess_dates(text: &str) -> BoxResult<String> {
    let dialect = if env::var("FINDR_US").is_ok() {
        Dialect::Us
    } else {
        Dialect::Uk
    };
    preprocess_string_arguments(text,"date",DATE_METHODS,|method,datestr| {
        let dt = parse_date_string(datestr,Local::now(),dialect)?;
        Ok(if method == "on" {
            // "on" is special - the datestr expands to _two_ timestamps spanning the day
            let day_start = dt.with_hour(0).unwrap().with_minute(0).unwrap();
            let day_end = day_start + Duration::days(1);
            format!("{},{}",day_start.timestamp(),day_end.timestamp())
        } else {
            dt.timestamp().to_string()
        })
    })
}
// convert date strings into Unix timestamps using chrono-english
convert date strings into Unix timestamps using chrono-english
convert date strings into Unix timestamps using chrono - english
fn preprocess_dates(text: &str) -> BoxResult<String> {
    let dialect = if env::var("FINDR_US").is_ok() {
        Dialect::Us
    } else {
        Dialect::Uk
    };
    preprocess_string_arguments(text,"date",DATE_METHODS,|method,datestr| {
        let dt = parse_date_string(datestr,Local::now(),dialect)?;
        Ok(if method == "on" {
            // "on" is special - the datestr expands to _two_ timestamps spanning the day
            let day_start = dt.with_hour(0).unwrap().with_minute(0).unwrap();
            let day_end = day_start + Duration::days(1);
            format!("{},{}",day_start.timestamp(),day_end.timestamp())
        } else {
            dt.timestamp().to_string()
        })
    })
}
fn preprocess_dates ( text : & str ) -> BoxResult < String > { let dialect = if env :: var ( " " ) . is_ok ( ) { Dialect :: Us } else { Dialect :: Uk } ; preprocess_string_arguments ( text , " " , DATE_METHODS , | method , datestr | { let dt = parse_date_string ( datestr , Local :: now ( ) , dialect ) ? ; Ok ( if method == " " { // "on" is special - the datestr expands to _two_ timestamps spanning the day let day_start = dt . with_hour ( 0 ) . unwrap ( ) . with_minute ( 0 ) . unwrap ( ) ; let day_end = day_start + Duration :: days ( 1 ) ; format ! ( " " day_start timestamp ( ) day_end timestamp ( ) ) } else { dt . timestamp ( ) . to_string ( ) } ) } ) }
convert date strings into Unix timestamps using chrono-english
convert date strings into Unix timestamps using chrono - english
text
&str
text
&str