Skip to content

Commit

Permalink
Merge pull request #673 from dp247/661-bcp-data-is-wrong
Browse files Browse the repository at this point in the history
Fix incorrect BCP data
  • Loading branch information
robbrad authored Apr 15, 2024
2 parents 07f5001 + ee2bed5 commit 66cb9b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions uk_bin_collection/uk_bin_collection/councils/BCPCouncil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from datetime import timedelta

import requests
from bs4 import BeautifulSoup
Expand All @@ -15,6 +16,7 @@ class CouncilClass(AbstractGetBinDataClass):
"""

def parse_data(self, page: str, **kwargs) -> dict:

user_uprn = kwargs.get("uprn")
check_uprn(user_uprn)

Expand All @@ -28,8 +30,8 @@ def parse_data(self, page: str, **kwargs) -> dict:

for bin in json_data:
bin_type = bin["BinType"]
next_date = datetime.strptime(bin["Next"], "%m/%d/%Y %H:%M:%S %p")
subseq_date = datetime.strptime(bin["Subsequent"], "%m/%d/%Y %H:%M:%S %p")
next_date = datetime.strptime(bin["Next"], "%m/%d/%Y %I:%M:%S %p") + timedelta(hours=1)
subseq_date = datetime.strptime(bin["Subsequent"], "%m/%d/%Y %I:%M:%S %p") + timedelta(hours=1)
collections.append((bin_type, next_date))
collections.append((bin_type, subseq_date))

Expand Down

0 comments on commit 66cb9b7

Please sign in to comment.