Add Time type

This commit is contained in:
Matthias Beyer 2016-05-28 17:53:20 +02:00
parent cc00e14cf7
commit ef81d87d94
2 changed files with 35 additions and 0 deletions

View file

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

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

@ -0,0 +1,34 @@
use chrono::naive::time::NaiveTime as ChronoNaiveTime;
use parse::Parse;
pub struct Time {
hour: u32,
minute: u32,
second: u32,
}
impl Time {
fn new(hour: u32, minute: u32, second: u32) -> Time {
unimplemented!()
}
}
impl Into<ChronoNaiveTime> for Time {
fn into(self) -> ChronoNaiveTime {
ChronoNaiveTime::from_hms(self.hour, self.minute, self.second)
}
}
impl Parse for Time {
fn parse(s: &str) -> Option<Time> {
unimplemented!()
}
}