Skip to content

Commit 6278b99

Browse files
authored
Merge pull request #1576 from neilmartin83/nm-rochford-datestring-2025-08-24
fix: RochfordCouncil date parsing
2 parents eba3b79 + b81eaf5 commit 6278b99

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

uk_bin_collection/uk_bin_collection/councils/RochfordCouncil.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ def parse_data(self, page: str, **kwargs) -> dict:
3333
"tr", {"class": "govuk-table__row"}
3434
):
3535
week_text = week.get_text().strip().split("\n")
36+
date_str = week_text[0].split(" - ")[0].split("–")[0].strip()
3637
collection_date = datetime.strptime(
37-
remove_ordinal_indicator_from_date_string(
38-
week_text[0].split(" - ")[0]
39-
).strip(),
38+
remove_ordinal_indicator_from_date_string(date_str),
4039
"%A %d %B",
4140
)
4241
next_collection = collection_date.replace(year=datetime.now().year)

0 commit comments

Comments
 (0)