var date_format = 'YYYY-MM-DD'; var time_format = 'hh:mm a'; $.ajax({ url: 'get_date_formats', type: 'GET', success: function(data) { date_format = data.date_format; time_format = data.time_format; } }); history_table_options = { "destroy": true, "responsive": { details: false }, "language": { "search": "Search: ", "lengthMenu":"Show _MENU_ entries per page", "info":"Showing _START_ to _END_ of _TOTAL_ history items", "infoEmpty":"Showing 0 to 0 of 0 entries", "infoFiltered":"(filtered from _MAX_ total entries)", "emptyTable": "No data in table", }, "stateSave": false, "sPaginationType": "bootstrap", "processing": false, "serverSide": true, "pageLength": 25, "order": [ 0, 'desc'], "columnDefs": [ { "targets": [0], "data":"date", "createdCell": function (td, cellData, rowData, row, col) { if (rowData['stopped'] === null) { $(td).addClass('currentlyWatching'); $(td).html('Currently watching...'); } else { $(td).html(moment(cellData,"X").format(date_format)); } }, "searchable": false, "className": "no-wrap" }, { "targets": [1], "data":"friendly_name", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { if (rowData['user_id'] !== '') { $(td).html('' + cellData + ''); } else { $(td).html('' + cellData + ''); } } else { $(td).html(cellData); } }, "className": "no-wrap" }, { "targets": [2], "data":"player", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { $(td).html(' '+cellData); } }, "className": "modal-control no-wrap" }, { "targets": [3], "data":"ip_address", "createdCell": function (td, cellData, rowData, row, col) { if ((cellData == '') || (cellData == '0')) { $(td).html('n/a'); } }, "className": "no-wrap" }, { "targets": [4], "data":"full_title", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { if (rowData['media_type'] === 'movie' || rowData['media_type'] === 'episode') { var transcode_dec = ''; if (rowData['video_decision'] === 'transcode') { transcode_dec = ' '; } $(td).html('