Releases: baoyachi/duration-str
Releases · baoyachi/duration-str
fix overflow
update License
Bump rust_decimal crates version
0.5.1 Update Cargo.toml
Refactor Result
fix #11
0.4.0: Merge pull request #10 from baoyachi/issue_8
Make the plus operator optional
add before,after NaiveDateTime function
0.3.7 update test
optimization parse_naive_date_time function
0.3.6 upgrade duration-str#0.3.6
add parse naive date time
#[cfg(feature = "chrono")]
pub fn parse_naive_date_time<S: Into>(input: S) -> anyhow::Resultchrono::NaiveDateTime {
let std_duration = parse_std(input)?;
let duration = chrono::Duration::from_std(std_duration)?;
let time = (Utc::now() + duration).naive_utc();
Ok(time)
}
#[cfg(feature = "chrono")]
pub fn parse_naive_date<S: Into>(input: S) -> anyhow::Resultchrono::NaiveDate {
let date = parse_naive_date_time(input)?;
Ok(date.date())
}
update repository url
0.3.4 update repository url