diff --git a/README.md b/README.md
index 7fb9d26..7c12fc6 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ When you [visit the app](https://trans-bdit.intra.prod-toronto.ca/traveltime-req
* a time range, given in hours of the day, 00 - 23
* a date range (note that the end of the date range is exclusive)
* a day of week selection
-* _coming soon_! a selection of whether or not to include statutory holidays
+* a selection of whether or not to include statutory holidays
The app will combine these factors together to request travel times for all possible combinations. If one of each type of factor is selected, only a single travel time will be estimated with the given parameters.
@@ -28,7 +28,7 @@ The app can return results in either CSV or JSON format. The fields in either ca
* time range
* date range
* days of week
-* holiday inclusion (will be added shortly)
+* holiday inclusion
The other fields may require some explanation:
@@ -39,7 +39,6 @@ The other fields may require some explanation:
| `hoursInRange` | The total number of hours that are theoretically within the scope of this request. This does not imply that data is/was available at all times. It's possible to construct requests with zero hours in range such as e.g `2023-01-01` to `2023-01-02`, Mondays only (There's only one Sunday in that range). Impossible combinations are included in the output for clarity and completeness but are not actually executed against the API and should return an error. |
-
## Methodology
Data for travel time estimation through the app are sourced from [HERE](https://github.com/CityofToronto/bdit_data-sources/tree/master/here)'s [traffic API](https://developer.here.com/documentation/traffic-api/api-reference.html) and are available back to about 2012. HERE collects data from motor vehicles that report their speed and position to HERE, most likely as a by-poduct of the driver making use of an in-car navigation system connected to the Internet.
diff --git a/backend/app/routes.py b/backend/app/routes.py
index fd57cca..e05a744 100644
--- a/backend/app/routes.py
+++ b/backend/app/routes.py
@@ -314,9 +314,7 @@ def aggregate_travel_times(start_node, end_node, start_time, end_time, start_dat
# test URL /date-bounds
@app.route('/date-bounds', methods=['GET'])
def get_date_bounds():
- """
- Get the earliest date and latest data in the travel database.
- """
+ "Get the earliest date and latest data in the travel database."
connection = getConnection()
with connection:
with connection.cursor() as cursor:
@@ -327,3 +325,21 @@ def get_date_bounds():
"start_time": min_date.strftime('%Y-%m-%d'),
"end_time": max_date.strftime('%Y-%m-%d')
}
+
+# test URL /holidays
+@app.route('/holidays', methods=['GET'])
+def get_holidays():
+ "Return dates of all known holidays in ascending order"
+ connection = getConnection()
+ with connection:
+ with connection.cursor() as cursor:
+ cursor.execute("""
+ SELECT
+ dt::text,
+ holiday
+ FROM ref.holiday
+ ORDER BY dt;
+ """)
+ dates = [ {'date': dt, 'name': nm} for (dt, nm) in cursor.fetchall()]
+ connection.close()
+ return dates
\ No newline at end of file
diff --git a/frontend/src/Sidebar/index.jsx b/frontend/src/Sidebar/index.jsx
index 0a5b9fe..e393f26 100644
--- a/frontend/src/Sidebar/index.jsx
+++ b/frontend/src/Sidebar/index.jsx
@@ -18,6 +18,8 @@ export default function SidebarContent(){