(function ($, document, apiClient) { var currentItem; var programs; function renderPrograms(page, result) { var html = ''; var currentIndexValue; var now = new Date(); for (var i = 0, length = result.Items.length; i < length; i++) { var program = result.Items[i]; var startDate = parseISO8601Date(program.StartDate, { toLocal: true }); var startDateText = LibraryBrowser.getFutureDateText(startDate); var endDate = parseISO8601Date(program.EndDate, { toLocal: true }); if (startDateText != currentIndexValue) { html += '