Skip to content

Commit

Permalink
fix: Fixing parsing to use full datetime (#48)
Browse files Browse the repository at this point in the history
* Fixing parsing to use full datetime

* Ensuring date check is the same

* Go back to just using date.today
  • Loading branch information
devinmatte authored Mar 29, 2024
1 parent 3f86672 commit 6e27567
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slowzones.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import requests
import logging
import argparse
from datetime import timedelta, date
from datetime import datetime, timedelta, date
from domains.mastodon import send_fixed_slow_zone_toots, send_new_slow_zone_toots, send_updated_slow_zone_toots
from domains.twitter import send_fixed_slow_zone_tweets, send_new_slow_zone_tweets, send_updated_slow_zone_tweets
from domains.slack import send_fixed_slow_zone_slacks, send_new_slow_zone_slacks, send_updated_slow_zone_slacks
Expand Down Expand Up @@ -46,9 +46,9 @@
def main():
slow_zones = requests.get("https://dashboard.transitmatters.org/static/slowzones/all_slow.json")

if date.fromisoformat(slow_zones.json()["updated_on"]) != date.today():
if datetime.fromisoformat(slow_zones.json()["updated_on"]).date() != date.today():
logging.error("Slow zone data was not updated yet today")
# exit if no issues
# exit if issues
sys.exit(1)

slow_zones_data = slow_zones.json()["data"]
Expand Down

0 comments on commit 6e27567

Please sign in to comment.