Add Time type
This commit is contained in:
parent
cc00e14cf7
commit
ef81d87d94
2 changed files with 35 additions and 0 deletions
|
@ -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
34
libimagtimeui/src/time.rs
Normal 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!()
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in a new issue