update rankings date update parsing logic.

This commit is contained in:
ZippyDev 2020-01-20 11:49:19 -07:00
parent 534f993864
commit f3bdbfb282
1 changed files with 8 additions and 5 deletions

View File

@ -32,11 +32,14 @@ module Ncaa
# @return [Time] # @return [Time]
def last_updated def last_updated
@last_updated ||= begin @last_updated ||=
updated = html.css('figure.rankings-last-updated').text begin
date = updated[/\w+{3,}\.? \d+{1,2}, \d+{2,4}/] updated = html.css('figure.rankings-last-updated').text
Time.parse(date) date = updated[/\w+{3,}\.? \d+{1,2}\,? \d+{2,4}/]
end Time.parse(date)
rescue TypeError
nil
end
end end
# @return [Array<Hash>] # @return [Array<Hash>]