/// Try change str to datetime.
Try change str to datetime.
Try change str to datetime .
fn try_str_to_date(&self, s: String) -> anyhow::Result<DateTime<Tz>> {
        let formats = vec![
            "%Y-%m-%d %H:%M",
            "%Y-%m-%d %H:%M:%S",
            "%Y%m%d %H:%M",
            "%Y%m%d %H:%M:%S",
            "%d%m%Y %H:%M",
            "%d%m%Y %H:%M:%S",
            "%Y/%m/%d %H:%M",
            "%Y/%m/%d %H:%M:%S",
        ];
        for f in formats {
            let result = self
                .location
                .as_ref()
                .unwrap()
                .datetime_from_str(s.as_str(), f);
            if let Ok(datetime) = result {
                return Ok(datetime);
            }
        }
        Err(anyhow::anyhow!("testfixtures: '{}' is invalid format", s))
    }
fn try_str_to_date ( & self , s : String ) -> anyhow :: Result < DateTime < Tz > > { let formats = vec ! [ " " " " " " " " " " " " " " " " ] ; for f in formats { let result = self . location . as_ref ( ) . unwrap ( ) . datetime_from_str ( s . as_str ( ) , f ) ; if let Ok ( datetime ) = result { return Ok ( datetime ) ; } } Err ( anyhow :: anyhow ! ( " " s ) ) }
Try change str to datetime.
Try change str to datetime .
&self
s
String