Skip to content
Permalink
Browse files

If date returned from database is already a date object then don't tr…

…y to parse it as a string. Fixes #1224
  • Loading branch information...
mlandauer committed Jul 11, 2019
1 parent 96d62e1 commit ec2858829d83b9271c868a384ddef44e7dc6950e
Showing with 5 additions and 1 deletion.
  1. +5 −1 app/controllers/api_controller.rb
@@ -192,7 +192,11 @@ def atom_footer
end

def parse_date(string)
DateTime.parse(string).rfc3339
if string.respond_to?(:rfc3339)
string.rfc3339
else
DateTime.parse(string).rfc3339
end
rescue ArgumentError
nil
end

0 comments on commit ec28588

Please sign in to comment.
You can’t perform that action at this time.