Skip to content

Commit

Permalink
fix end date
Browse files Browse the repository at this point in the history
  • Loading branch information
skaplan-dev committed Sep 11, 2023
1 parent 503f5ba commit a70fb7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime, timedelta
from datetime import datetime, timedelta, date
import json
import operator
from itertools import groupby
Expand Down Expand Up @@ -162,7 +162,7 @@ def generate_data_dashboard_link(sz):
stop1 = sz["fr_id"]
stop2 = sz["to_id"]
start = (datetime.strptime(sz["start"], "%Y-%m-%dT%H:%M:%S") - timedelta(days=14)).strftime("%Y-%m-%d")
end = (datetime.strptime(sz["end"], "%Y-%m-%dT%H:%M:%S") + timedelta(days=2)).strftime("%Y-%m-%d")
end = date.today().strftime("%Y-%m-%d")
link = f"https://dashboard.transitmatters.org/{color}/trips/multi/?from={stop1}&to={stop2}&startDate={start}&endDate={end}"
logging.debug(f"Generated Data Dashboard link: {link}")
return link
Expand Down

0 comments on commit a70fb7c

Please sign in to comment.