홍용민

예측시간 저장 배열 변수 추가

...@@ -63,6 +63,7 @@ for(var i=0; i<routeID.length; i++){ ...@@ -63,6 +63,7 @@ for(var i=0; i<routeID.length; i++){
63 63
64 const GateBusUrl = bus_url + '?servicekey=' + process.env.key + '&stationId=' + gateStationID; //국제캠 정문 정류장 64 const GateBusUrl = bus_url + '?servicekey=' + process.env.key + '&stationId=' + gateStationID; //국제캠 정문 정류장
65 let date = new Date(); 65 let date = new Date();
66 +let predictTime;
66 67
67 function predict(){ 68 function predict(){
68 console.log(GateBusUrl); 69 console.log(GateBusUrl);
...@@ -92,13 +93,15 @@ function predict(){ ...@@ -92,13 +93,15 @@ function predict(){
92 93
93 Bus[index]["MinPredictTime"] = predictHour1 + ":" + predictMinute1; 94 Bus[index]["MinPredictTime"] = predictHour1 + ":" + predictMinute1;
94 Bus[index]["MaxPredictTime"] = predictHour2 + ":" + predictMinute2; 95 Bus[index]["MaxPredictTime"] = predictHour2 + ":" + predictMinute2;
96 +
97 + predictTime = [Bus[index].MinPredictTime, Bus[index].MaxPredictTime];
95 } 98 }
96 }) 99 })
97 }) 100 })
98 } 101 }
99 102
100 -function useWhile(){ 103 +function start(){
101 setInterval(predict, 60000); 104 setInterval(predict, 60000);
102 } 105 }
103 106
104 -setTimeout(useWhile, 20000);
...\ No newline at end of file ...\ No newline at end of file
107 +setTimeout(start, 20000);
...\ No newline at end of file ...\ No newline at end of file
......