Skip to content

Commit

Permalink
fix stoke_gov_uk as some addresses my provide different date format (#…
Browse files Browse the repository at this point in the history
…1368)

Co-authored-by: 5ila5 <5ila5@users.noreply.github.com>
  • Loading branch information
5ila5 and 5ila5 authored Oct 28, 2023
1 parent 229b15d commit 18a2dae
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

API_URL = "https://www.stoke.gov.uk/jadu/custom/webserviceLookUps/BarTecWebServices_missed_bin_calendar.php?UPRN="

DATE_FORMAT = "%d/%m/%Y %H:%M:%S" # format of the date string in the collection table
DATE_FORMAT = "%d/%m/%Y" # format of the date string in the collection table


class Source:
Expand All @@ -44,7 +44,7 @@ def fetch(self):
bintype = "RES"

# round_name = bin_round.find('RoundName').text
date_time = bin_round.find("DateTime").text
date_time = bin_round.find("DateTime").text.split(" ")[0]

date = datetime.strptime(date_time, DATE_FORMAT).date()
entries.append(Collection(date=date, t=bin, icon=ICON_MAP.get(bintype)))
Expand Down

0 comments on commit 18a2dae

Please sign in to comment.