<html><head><style> span{font: bold 120% sans-serif; }</style></head><body>
<script>
var times = [
"8:00","8:30","9:00","9:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30",
"15:00","15:30","16:00","16:30","17:00","17:30","18:00","18:30","19:00","19:30","20:00", "20:30", "21:00"];
var html = "";
var now = new Date();
now = now.getHours() * 60 + now.getMinutes();
// сам алгоритм
var nextTripFinded = false;
for(var i = 0; i < times.length; i++) {
var t = times[i].split(":");
var isFollowingTrip = t[0] * 60 + +t[1] > now;
var s = isFollowingTrip ? '' : 'color: gray;';
if(!nextTripFinded && isFollowingTrip) {
nextTripFinded=true;
s += 'background:yellow;';
}
if(s) s = 'style="' + s + '"';
html += '<span ' + s + '>' + times[i] + '</span> ';
}
// конец алгоритма
document.body.innerHTML = html;
</script></body></html>