1
0
Fork 0
mirror of https://github.com/SocksPls/hltv-api synced 2025-04-29 23:23:08 +00:00

Merge pull request #36 from SocksPls/fix-countdown-date-replace

fix(countdown): replace
This commit is contained in:
David Silva 2022-07-26 14:39:59 +02:00 committed by GitHub
commit 1390409c08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,7 +375,7 @@ def get_match_countdown(match_id):
timeAndEvent = match_page.find("div", {"class": "timeAndEvent"})
date = timeAndEvent.find("div", {"class": "date"}).text
time = timeAndEvent.find("div", {"class": "time"}).text
dateArr = date.replace("th of","").split()
dateArr = date.replace("th of","").replace("rd of","").replace("st of","").replace("nd of","").split()
dateTextFromArrPadded = _padIfNeeded(dateArr[2]) + "-" + _padIfNeeded(_monthNameToNumber(dateArr[1])) + "-" + _padIfNeeded(dateArr[0])
dateFromHLTV = datetime.datetime.strptime(dateTextFromArrPadded,'%Y-%m-%d').replace(tzinfo=HLTV_ZONEINFO)