Made current hours highlighted on schedules.

This commit is contained in:
Bram van der Veen 2015-08-14 15:50:41 +02:00
parent 2bad728b68
commit 684d7c7a52
2 changed files with 3 additions and 3 deletions

View file

@ -21,8 +21,8 @@ if !easter || easter.type != "RIP"
span= days[match.json.indexOf(day)] span= days[match.json.indexOf(day)]
each hour in day each hour in day
if hour.teacher != 'vrij' if hour.teacher != 'vrij'
.hour(class=hour.changed == 'true' ? 'changed' : '') .hour(class=(hour.changed == 'true' ? 'changed' : '') + (app.locals.time.within_timespan(app.locals.hour_times[match.json[0].indexOf(hour)) ? ' current' : ''))
each subhour in hour.teacher each subhour in hour.teachaer
span.teacher(class='sub_' + hour.teacher.length) span.teacher(class='sub_' + hour.teacher.length)
a(href=hour.teacher[hour.teacher.indexOf(subhour)])= hour.teacher[hour.teacher.indexOf(subhour)] a(href=hour.teacher[hour.teacher.indexOf(subhour)])= hour.teacher[hour.teacher.indexOf(subhour)]
span.chamber(class='sub_' + hour.teacher.length) span.chamber(class='sub_' + hour.teacher.length)

View file

@ -7,7 +7,7 @@ function get() {
return time.getHours() + (time.getMinutes() / 60); return time.getHours() + (time.getMinutes() / 60);
} }
//Function for convert hh:mm to fractured time //Function for convert hh:mm to fractured time (hh.hh)
function parse(timestr) { function parse(timestr) {
var parsed = timestr.match(/\d{1,2}:\d+/g); var parsed = timestr.match(/\d{1,2}:\d+/g);
var array = []; var array = [];