I think you can basically get rid of this entire for loop if you run a regex over className or use a data- attribute. E.g.,

````
var hour = el.className.match(/hour-([\d]+)/)[1];
````