Impl Parse::parse for DateTime
This commit is contained in:
parent
3d066e6633
commit
ff82300746
1 changed files with 3 additions and 1 deletions
|
@ -39,7 +39,9 @@ impl Into<ChronoNaiveDateTime> for DateTime {
|
||||||
impl Parse for DateTime {
|
impl Parse for DateTime {
|
||||||
|
|
||||||
fn parse(s: &str) -> Option<DateTime> {
|
fn parse(s: &str) -> Option<DateTime> {
|
||||||
unimplemented!()
|
Date::parse(s)
|
||||||
|
.and_then(|d| Time::parse(s).map(|t| (d, t)))
|
||||||
|
.map(|(d, t)| DateTime::new(d, t))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue