Skip to content

Commit

Permalink
fix zomato dt
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Mar 30, 2024
1 parent 5d4e4df commit d2d499c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/zomato.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,19 @@ def get_event_details(event_id, zomaland = False):

def parse_datetime(dt):
tz = datetime.timezone(datetime.timedelta(hours=5, minutes=30)) # Asia/Kolkata timezone
print(dt)
(start,end) = dt.split("-")
r_start = None
print(start)
for d in list(datefinder.find_dates(start)):
days = (d - datetime.datetime.now()).days
if days > 0 and days < 90:
if days >= 0 and days < 90:
r_start = d
break
for dd in list(datefinder.find_dates(end, base_date = r_start)):
r_end = dd
break

if r_start == None:
return None
return (None,None)

# Move end by 1 day
if r_end < r_start:
Expand Down

0 comments on commit d2d499c

Please sign in to comment.