Skip to content

Commit

Permalink
Force local events to IST as well
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Jul 18, 2024
1 parent f27927b commit a7aab66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/event-fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ def get_local_events(files, filt):
for event in data:
if '@id' in event and event["@id"] in IGNORED_EVENT_UIDS:
continue
for x in ["startDate", "endDate"]:
if x in event:
try:
event[x] = datetime.fromisoformat(event[x]).astimezone(IST).isoformat()
except Exception as e:
print(f"Error parsing {x} for {event['url']}")

event = apply_patch(event, patch)
yield (event["url"], event)
print(f"Processed {i} in {time.time() - start_ts:.2f}s")
Expand Down

0 comments on commit a7aab66

Please sign in to comment.