Add DateTime type
This commit is contained in:
parent
ef81d87d94
commit
cc448e4754
2 changed files with 36 additions and 0 deletions
35
libimagtimeui/src/datetime.rs
Normal file
35
libimagtimeui/src/datetime.rs
Normal file
|
@ -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<ChronoNaiveDateTime> for DateTime {
|
||||
|
||||
fn into(self) -> ChronoNaiveDateTime {
|
||||
ChronoNaiveDateTime::new(self.date.into(), self.time.into())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Parse for DateTime {
|
||||
|
||||
fn parse(s: &str) -> Option<DateTime> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -6,5 +6,6 @@ extern crate regex;
|
|||
#[macro_use] extern crate libimagerror;
|
||||
|
||||
pub mod date;
|
||||
pub mod datetime;
|
||||
pub mod time;
|
||||
|
||||
|
|
Loading…
Reference in a new issue