Showing time until departure if under 10 mins
parent
6bfab05718
commit
5d28934e94
|
@ -74,6 +74,8 @@ function refreshContent() {
|
||||||
|
|
||||||
timeDifference = busTime.diff( now, 'minutes' );
|
timeDifference = busTime.diff( now, 'minutes' );
|
||||||
|
|
||||||
|
timeLeftMessage = 'departure in ' + timeDifference + 'minutes';
|
||||||
|
|
||||||
if ( timeDifference <= 5 ) {
|
if ( timeDifference <= 5 ) {
|
||||||
|
|
||||||
labelColor = "danger";
|
labelColor = "danger";
|
||||||
|
@ -85,10 +87,11 @@ function refreshContent() {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
labelColor = "info";
|
labelColor = "info";
|
||||||
|
timeLeftMessage = '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
content += '<h1>' + time + ' <span class="label label-' + labelColor + ' label-lg">' + name + '</span></h1>' + destination;
|
content += '<h1>' + time + ' <span class="label label-' + labelColor + ' label-lg">' + name + '</span> ' + destination + '</h1>' + timeLeftMessage;
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue