diff options
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/lib.rs | 11 | ||||
-rw-r--r-- | src/timetype.rs | 21 |
3 files changed, 27 insertions, 6 deletions
@@ -13,3 +13,4 @@ license = "MPL-2.0" repository = "https://github.com/matthiasbeyer/kairos" [dependencies] +chrono = "0.4" @@ -1,6 +1,5 @@ -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - } -} + +extern crate chrono; + +pub mod timetype; + diff --git a/src/timetype.rs b/src/timetype.rs new file mode 100644 index 0000000..b6de84e --- /dev/null +++ b/src/timetype.rs @@ -0,0 +1,21 @@ +//! The module for the TimeType +//! + +use chrono::NaiveDateTime; + +/// A Type of Time, currently based on chrono::NaiveDateTime +pub enum TimeType { + Seconds(usize), + Minutes(usize), + Hours(usize), + Days(usize), + Weeks(usize), + Months(usize), + Years(usize), + + Moment(NaiveDateTime), + + Addition(Box<TimeType>, Box<TimeType>), + Subtraction(Box<TimeType>, Box<TimeType>), +} + |