--- a/tripPlanner.php +++ b/tripPlanner.php @@ -5,7 +5,10 @@ $to = (isset($_REQUEST['to']) ? filter_var($_REQUEST['to'], FILTER_SANITIZE_STRING) : "Barry"); $date = (isset($_REQUEST['date']) ? filter_var($_REQUEST['date'], FILTER_SANITIZE_STRING) : date("m/d/Y")); $time = (isset($_REQUEST['time']) ? filter_var($_REQUEST['time'], FILTER_SANITIZE_STRING) : date("H:i")); -// todo: convert date from form to h:ia? +function formatTime($timeString) { + $timeParts = explode("T",$timeString); + return str_replace("Z","",$timeParts[1]); +} function tripPlanForm($errorMessage = "") { global $date, $time, $from, $to; @@ -40,7 +43,7 @@ } function processItinerary($itineraryNumber, $itinerary) { - echo '
"; + echo '
";
echo "Walking time: " . floor($itinerary->walkTime / 60000) . " minutes (" . floor($itinerary->walkDistance) . " meters)
\n";
echo "Transit time: " . floor($itinerary->transitTime / 60000) . " minutes
\n";
echo "Waiting time: " . floor($itinerary->waitingTime / 60000) . " minutes
\n";
@@ -119,7 +122,7 @@
$tripplan = json_decode($page);
debug(print_r($triplan, true));
echo "