date_component

calculate date interval with chrono.

API

https://gpgkd906.github.io/datecomponent/datecomponent/

Example

```rust use chrono::prelude::*; use datecomponent::datecomponent;

fn main() { let date1 = Utc.ymd(2015, 4, 20).andhms(0, 0, 0); let date2 = Utc.ymd(2015, 12, 19).andhms(0, 0, 0);

let date_interval = date_component::calculate(&date1, &date2);
println!("{:?}", date_interval);

} // DateComponent { year: 0, month: 7, week: 4, modulodays: 1, day: 29, hour: 0, minute: 0, second: 0, intervalseconds: 20995200, intervalminutes: 349920, intervalhours: 5832, interval_days: 243, invert: false } ```

Tests

Run tests with cargo test. see src/lib.rs.