Skip to content

Commit

Permalink
Updated date import
Browse files Browse the repository at this point in the history
  • Loading branch information
Shidash committed Jan 4, 2017
1 parent 1a98b20 commit 54f4735
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/date_funcs.rb
Expand Up @@ -66,7 +66,7 @@ def handle_foreign_dates(f, item, date_field)
item[date_field] = nil
end
end

return item
end

Expand All @@ -82,12 +82,13 @@ def process_date(f, item)

# Handle dates that are parsed correctly
begin
item[date_field] = Date.parse(item[date_field])
item[date_field] = DateTime.parse(item[date_field])
rescue # Handle dates that aren't parsed correctly
item = handle_year_only(f, item, date_field)
item = handle_foreign_dates(f, item, date_field)
end
end

return item
end

Expand Down

0 comments on commit 54f4735

Please sign in to comment.