diff --git a/databaseOperations.php b/databaseOperations.php index 565304a..2664f2e 100755 --- a/databaseOperations.php +++ b/databaseOperations.php @@ -164,7 +164,7 @@ function getCategoriesForOneEvent($db, $eventId) /** * @brief queries the database for the events on a certain date * @param $db: the PDO connection to the database - * @param $date: the date to search for + * @param $date: the date to search for (please use strtotime) * @return a list of all the events at the date $date */ function getEventsByDate($db, $date) @@ -172,7 +172,7 @@ function getEventsByDate($db, $date) try { $request = $db->prepare('SELECT * FROM event WHERE (event_dtstart <= :date AND event_dtend >= :date)'); - $request->execute(array('date'=>date("Y-m-d",strtotime($date)))); + $request->execute(array('date'=>date("Y-m-d",$date))); $result = $request->fetchAll(); $request->closeCursor(); return $result; diff --git a/day.php b/day.php index cd10578..e5bf648 100644 --- a/day.php +++ b/day.php @@ -2,7 +2,7 @@ include_once('databaseOperations.php'); $db = connect(); -$date = htmlspecialchars($_GET['date']); +$date = strtotime(htmlspecialchars($_GET['date'])); ?> @@ -21,14 +21,14 @@ $date = htmlspecialchars($_GET['date']);