Impl Parse::parse for DateTime

This commit is contained in:
Matthias Beyer 2016-05-28 20:41:35 +02:00
parent 3d066e6633
commit ff82300746

View file

@ -39,7 +39,9 @@ impl Into<ChronoNaiveDateTime> for DateTime {
impl Parse for 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))
}
}