Showing time until departure if under 10 mins

master
Thierry Degeling 2014-07-20 14:50:30 +02:00
parent 6bfab05718
commit 5d28934e94
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}); });