Skip to content

Commit

Permalink
Use dateutil's parser to parse dates - makes everything more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
AceFire6 committed Mar 21, 2019
1 parent 962ecc2 commit d658f5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ordering/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from concurrent.futures import as_completed, ThreadPoolExecutor
from datetime import datetime

from dateutil.parser import parse as parse_date_string
from operator import itemgetter
import re
Expand Down Expand Up @@ -73,7 +74,7 @@ def get_episode_list(series_soup, series):
date = row[-1]
reference = re.search(r'\[\d+\]$', row[-1])
date = date[:reference.start()] if reference else date
row[-1] = air_date = datetime.strptime(date, '%B %d, %Y').date()
row[-1] = air_date = parse_date_string(date).date()
except ValueError:
continue

Expand Down

0 comments on commit d658f5f

Please sign in to comment.