mirror of
https://github.com/sascha-hemi/hacs_waste_collection_schedule.git
synced 2026-03-21 02:04:22 +01:00
Oxford city: Support shortened month name
This commit is contained in:
@@ -58,9 +58,13 @@ class Source:
|
||||
matches = re.match(r"^(\w+) Next Collection: (.*)", paragraph.text)
|
||||
if matches:
|
||||
collection_type, date_string = matches.groups()
|
||||
try:
|
||||
date = datetime.strptime(date_string, "%A %d %B %Y").date()
|
||||
except ValueError:
|
||||
date = datetime.strptime(date_string, "%A %d %b %Y").date()
|
||||
entries.append(
|
||||
Collection(
|
||||
date=datetime.strptime(date_string, "%A %d %B %Y").date(),
|
||||
date=date,
|
||||
t=collection_type,
|
||||
icon=ICON_MAP.get(collection_type),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user