Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍용민
/
BusTime
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
홍용민
2021-06-10 11:22:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7f54e7c0b2fdfa9eed2d224477030c5c6eef63a8
7f54e7c0
1 parent
bb7612a2
NaN 수정
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
.gitignore
models/BusInfo.js
.gitignore
View file @
7f54e7c
test.js
BusInfo.txt
/node_modules
.env
\ No newline at end of file
...
...
models/BusInfo.js
View file @
7f54e7c
...
...
@@ -39,9 +39,9 @@ function getBusNum(){
newBus
.
LastTime
=
lasttime
;
newBus
.
MinTime
=
mintime
;
newBus
.
MaxTime
=
maxtime
;
console
.
log
(
newBus
);
//
console.log(newBus);
Bus
.
push
(
newBus
);
console
.
log
(
Bus
);
//
console.log(Bus);
})
})
}
...
...
@@ -63,9 +63,9 @@ function predict(){
//var num = $(this).find('plateNo1').text(); // 버스 차량번호 ex) 70사 1290
var
time
=
$
(
this
).
find
(
'predictTime1'
).
text
();
// 버스 예상 도착시간
var
predictHour1
=
date
.
getHours
();
var
predictMinute1
=
date
.
getMinutes
()
+
Bus
[
index
].
mintime
-
(
3
-
(
time
*
1
));
// 사색의 광장 -> 경희대학교 3분정도 소요
var
predictMinute1
=
date
.
getMinutes
()
+
parseInt
(
Bus
[
index
].
MinTime
)
-
(
3
-
parseInt
(
time
));
// 사색의 광장 -> 경희대학교 3분정도 소요
var
predictHour2
=
date
.
getHours
();
var
predictMinute2
=
date
.
getMinutes
()
+
Bus
[
index
].
maxtime
-
(
3
-
(
time
*
1
));
// time*1 : string to integer 형변환
var
predictMinute2
=
date
.
getMinutes
()
+
parseInt
(
Bus
[
index
].
MaxTime
)
-
(
3
-
parseInt
(
time
));
// time*1 : string to integer 형변환
if
(
predictMinute1
>=
60
){
predictHour1
+=
1
;
predictMinute1
-=
60
;
...
...
Please
register
or
login
to post a comment