diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime.rs | 3 | ||||
-rw-r--r-- | src/de.rs | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/datetime.rs b/src/datetime.rs index c67e2c4..3678f58 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -176,7 +176,8 @@ impl FromStr for Datetime { // Next parse the "partial-time" if available let partial_time = if full_date.is_some() && - chars.clone().next() == Some('T') { + (chars.clone().next() == Some('T') + || chars.clone().next() == Some(' ')) { chars.next(); true } else { @@ -1010,6 +1010,17 @@ impl<'a> Deserializer<'a> { -> Result<(Span, &'a str), Error> { let start = self.tokens.substr_offset(date); + // Check for space separated date and time. + if let Some((_, Token::Whitespace(s))) = self.peek()? { + if s == " " { + self.next()?; + // Skip past the hour. + if let Some((_, Token::Keylike(_))) = self.peek()? { + self.next()?; + } + } + } + if colon_eaten || self.eat(Token::Colon)? { // minutes match self.next()? { |