diff --git a/src/js/components/root.js b/src/js/components/root.js
index 6c5a4b4..f8efe3f 100644
--- a/src/js/components/root.js
+++ b/src/js/components/root.js
@@ -113,12 +113,14 @@ class RouteSearch extends Component {
constructor(props) {
super(props);
const now = new Date();
+ const hours = now.getHours();
this.state = {
fromStation: "",
toStation: "",
depart: 'now',
min: now.getMinutes(),
- hour: now.getHours(),
+ hour: hours === 0 ? 12 : hours % 12,
+ isPM: hours >= 12
};
}
@@ -134,7 +136,11 @@ class RouteSearch extends Component {
evt.preventDefault();
api.action("bartinfo", "json", {
from: this.state.fromStation,
- to: this.state.toStation});
+ to: this.state.toStation,
+ min: this.state.min,
+ hour: this.state.hour,
+ isPM: this.state.isPM,
+ });
}
changeStation(evt) {
@@ -155,10 +161,12 @@ class RouteSearch extends Component {
setDepartAt(evt) {
evt.preventDefault();
const now = new Date();
+ const hours = now.getHours();
this.setState({
depart: "givenTime",
- hour: now.getHours(),
min: now.getMinutes(),
+ hour: hours === 0 ? 12 : hours % 12,
+ isPM: hours >= 12
});
}
@@ -182,13 +190,30 @@ class RouteSearch extends Component {
-