(function ($, document, apiClient) { function deleteTimer(page, id) { Dashboard.confirm("Are you sure you wish to cancel this timer?", "Confirm Timer Cancellation", function (result) { if (result) { Dashboard.showLoadingMsg(); ApiClient.cancelLiveTvTimer(id).done(function () { Dashboard.alert('Timer deleted'); reload(page); }); } }); } function renderTimers(page, timers) { var html = ''; var cssClass = "detailTable"; html += '
'; html += ' | Name | '; html += 'Channel | '; html += 'Date | '; html += 'Start | '; html += 'Length | '; html += 'Status | '; html += 'Series | '; html += '
---|---|---|---|---|---|---|---|
'; html += ''; html += ' | '; html += ''; html += '' + timer.Name + ''; html += ' | '; html += ''; if (timer.ChannelId) { html += '' + timer.ChannelName + ''; } html += ' | '; var startDate = timer.StartDate; try { startDate = parseISO8601Date(startDate, { toLocal: true }); } catch (err) { } html += '' + startDate.toLocaleDateString() + ' | '; html += '' + LiveTvHelpers.getDisplayTime(timer.StartDate) + ' | '; var minutes = timer.DurationMs / 60000; html += '' + minutes.toFixed(0) + ' mins | '; html += '' + (timer.Status || '') + ' | '; html += ''; if (timer.SeriesTimerId) { html += ''; html += 'View'; html += ''; } html += ' | '; html += '