From cc448e4754302bc03167d2ec1dabaedc6ea40724 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 May 2016 17:53:29 +0200 Subject: [PATCH] Add DateTime type --- libimagtimeui/src/datetime.rs | 35 +++++++++++++++++++++++++++++++++++ libimagtimeui/src/lib.rs | 1 + 2 files changed, 36 insertions(+) create mode 100644 libimagtimeui/src/datetime.rs diff --git a/libimagtimeui/src/datetime.rs b/libimagtimeui/src/datetime.rs new file mode 100644 index 00000000..610ed5a7 --- /dev/null +++ b/libimagtimeui/src/datetime.rs @@ -0,0 +1,35 @@ +use chrono::naive::datetime::NaiveDateTime as ChronoNaiveDateTime; + +use parse::Parse; +use date::Date; +use time::Time; + +pub struct DateTime { + date: Date, + time: Time, +} + +impl DateTime { + + fn new(date: Date, time: Time) -> DateTime { + unimplemented!() + } + +} + +impl Into for DateTime { + + fn into(self) -> ChronoNaiveDateTime { + ChronoNaiveDateTime::new(self.date.into(), self.time.into()) + } + +} + +impl Parse for DateTime { + + fn parse(s: &str) -> Option { + unimplemented!() + } + +} + diff --git a/libimagtimeui/src/lib.rs b/libimagtimeui/src/lib.rs index 2d527f50..ef2bab0a 100644 --- a/libimagtimeui/src/lib.rs +++ b/libimagtimeui/src/lib.rs @@ -6,5 +6,6 @@ extern crate regex; #[macro_use] extern crate libimagerror; pub mod date; +pub mod datetime; pub mod time;