Skip to content

Commit

Permalink
use current year and month instead of hardcoded value
Browse files Browse the repository at this point in the history
  • Loading branch information
mahathu committed Feb 26, 2022
1 parent 93dfbb1 commit d16bfda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import EventsList from "./components/EventsList.svelte";
import { writable } from "svelte/store";
async function fetchTickets() { //returns a promise
//TODO: instead make API call and get bath info from server
let all_events = [];
Expand Down
4 changes: 3 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from flask import Flask, send_from_directory, jsonify
from datetime import datetime
import scraping
app = Flask(__name__)

Expand All @@ -13,8 +14,9 @@ def home(path):

@app.route("/api/ticketinfo/<int:bath_id>")
def get_tickets_for_bath(bath_id):
today = datetime.now()
events = [dict(event, name=scraping.baths[bath_id])
for event in scraping.get_slot_info(bath_id, 2022, 2)]
for event in scraping.get_slot_info(bath_id, today.year, today.month)]
return jsonify(events)

@app.route("/api/ticketinfo")
Expand Down

0 comments on commit d16bfda

Please sign in to comment.