(function ($, document, apiClient) { function renderTimers(page, timers) { var html = ''; var cssClass = "detailTable"; html += '
'; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; for (var i = 0, length = timers.length; i < length; i++) { var timer = timers[i]; html += ''; html += ''; html += ''; html += ''; var startDate = timer.StartDate; try { startDate = parseISO8601Date(startDate, { toLocal: true }); } catch (err) { } html += ''; html += ''; html += ''; html += ''; html += ''; html += ''; } html += '
 NameChannelDateStartEndStatusRecurring Schedule
'; html += ''; html += ''; html += '' + (timer.Name || '') + '' + (timer.ChannelName || '') + '' + startDate.toLocaleDateString() + '' + LiveTvHelpers.getDisplayTime(timer.StartDate) + '' + LiveTvHelpers.getDisplayTime(timer.EndDate) + '' + (timer.Status || '') + '
'; var elem = $('#items', page).html(html).trigger('create'); } function reload(page) { apiClient.getLiveTvTimers().done(function (result) { renderTimers(page, result.Items); }); } $(document).on('pagebeforeshow', "#liveTvTimersPage", function () { var page = this; reload(page); }); })(jQuery, document, ApiClient);