I'm making a custom calendar. I'm working on the position of the calendar days. I'm working on a function that needs to find the first time a condition is true.
Looking at my code below, I need to console.log("test") only the first time var J has a greater value than var currentDate.
Here is my code: http://jsfiddle.net/c33Xj/
$("#Cal tbody tr:first-child td").each(function(){
var currentDate = (new Date).getDate();
var h = $(this).text();
if (h == weekDays[currentDay]) {
var j = $(this).index();
console.log(j);
}
});
j? I mean what$(this).index()exactly is? Day of month? 0 = first day? Or 1 = first day? or what?