(function ($, document, apiClient) { function editTimer(page, id) { } function deleteTimer(page, id) { Dashboard.confirm("Are you sure you wish to cancel this timer?", "Confirm Timer Deletion", 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 += 'End | '; html += 'Status | '; html += 'Recurring | '; html += '
---|---|---|---|---|---|---|---|
'; html += ''; html += ' | '; html += '' + (timer.Name || '') + ' | '; 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) + ' | '; html += '' + LiveTvHelpers.getDisplayTime(timer.EndDate) + ' | '; html += '' + (timer.Status || '') + ' | '; html += ''; if (timer.IsRecurring) { html += ' '; html += '✓'; } html += ' | '; html += '