Doing an assignment in the condition part of a 'if', 'while' or 'for' statement is highly not recommended for the two following reasons :
if (dayNumber = getClickedDayNumber(dayInfo)) { // Non-Compliant
alert("day number found : " + dayNumber);
}
If you really want to do the assignment in place, then better to do an explicit comparison as well :
if ((value = someFunction()) === true) { // Compliant
// ...
}