jQuery datepicker - for loop issue in 'beforeShowDay'
===

I've been struggling to figure out what's wrong with my function for the past day or two, and just can't seem to find the right solution to fit my situation. Here's what I have so far:

**Relevant portion of the jQuery:**

    function calendarModify() {
	var cal = $(".caledit");
	$.ajax({
		url: "calprocess.php?action=showdates",
		type: "POST",
		dataType: "json",
		success: function (events) {
			cal.datepicker({
				showButtonPanel: true,
				dateFormat: "yy-mm-dd",
				beforeShowDay: function (dates) {
					var d = ('0' + dates.getDate()).slice(-2),
						m = ('0' + (dates.getMonth() + 1)).slice(-2),
						y = dates.getFullYear(),
						date = y + "-" + m + "-" + d;
					for (var i = 0; i < events.length; i++) {
						if (events[i].event_date === date) {
							return [true, "event", events[i].event_desc];
						}
						else {
							return [true, ""];
						}
					}
				}
    (there's more, but it's all working properly)
I've narrowed the issue down to the for loop in `beforeShowDay` so far. I'm grabbing JSON information via AJAX from a PHP file that spits out entries from a mySQL db. I did some `console.log()` checks, and it looks like events contains the correct amount of objects, and prints out the correct values of the db fields... the loop just isn't... looping.

Maybe I'm missing something obvious, but I'm new to jQuery and new to programming, so it's more than likely just beginner's ignorance at play in this case. I'm completely open to any suggestions for optimizations and fixes you might toss my way.