It is for verifying the days in February.
I've never seen ? and : used like this so I would like some clarification.
Is this saying that if the day<=29/28 then set valid to true, otherwise false?
Would I be correct in assuming that?
Yes, you are correct. That's exactly how the ternary operator works:
(some_condition) ? (use_if_true) : (use_if_false)
1 2 3 4 5 6 7 8 9 10 11
(day<=29) ? valid=true : valid=false;
// is the same as this:
if(day <= 29)
valid = true;
valid = false;
// but of course, a bit more sane way to write it would be like this:
valid = (day <= 29);