Add Date type

This commit is contained in:
Matthias Beyer 2016-05-28 17:53:13 +02:00
parent 42b79bb0ee
commit cc00e14cf7
2 changed files with 37 additions and 0 deletions

34
libimagtimeui/src/date.rs Normal file
View file

@ -0,0 +1,34 @@
use chrono::naive::date::NaiveDate as ChronoNaiveDate;
use parse::Parse;
pub struct Date {
year: i32,
month: u32,
day: u32,
}
impl Date {
fn new(year: i32, month: u32, day: u32) -> Date {
unimplemented!()
}
}
impl Into<ChronoNaiveDate> for Date {
fn into(self) -> ChronoNaiveDate {
ChronoNaiveDate::from_ymd(self.year, self.month, self.day)
}
}
impl Parse for Date {
fn parse(s: &str) -> Option<Date> {
unimplemented!()
}
}

View file

@ -4,3 +4,6 @@ extern crate regex;
#[macro_use] extern crate log; #[macro_use] extern crate log;
#[macro_use] extern crate libimagerror; #[macro_use] extern crate libimagerror;
pub mod date;