diff --git a/docs/prune-simulator/index.html b/docs/prune-simulator/index.html index 22fa66f6..b4ea5370 100644 --- a/docs/prune-simulator/index.html +++ b/docs/prune-simulator/index.html @@ -6,6 +6,31 @@ PBS Prune Simulator + + diff --git a/docs/prune-simulator/prune-simulator.js b/docs/prune-simulator/prune-simulator.js index 53da49df..2e13f03b 100644 --- a/docs/prune-simulator/prune-simulator.js +++ b/docs/prune-simulator/prune-simulator.js @@ -175,7 +175,7 @@ Ext.onReady(function() { let me = this; let backups = me.store.data.items; - let html = ''; + let html = '
'; let now = new Date(NOW.getTime()); let skip = 7 - parseInt(Ext.Date.format(now, 'N'), 10); @@ -187,38 +187,39 @@ Ext.onReady(function() { html += ''; for (let j = 0; j < 7; j++) { - html += '
'; - let date = Ext.Date.subtract(tableStartDate, Ext.Date.DAY, j + 7 * i); let currentDay = Ext.Date.format(date, 'd/m/Y'); - let isBackupOnDay = function(backup, day) { + let dayOfWeekCls = Ext.Date.format(date, 'D').toLowerCase(); + let firstOfMonthCls = Ext.Date.format(date, 'd') === '01' + ? 'first-of-month' + : ''; + html += ``; + + const isBackupOnDay = function(backup, day) { return backup && Ext.Date.format(backup.data.backuptime, 'd/m/Y') === day; }; let backup = backups[bIndex]; - html += ''; + html += '
' + - Ext.Date.format(date, 'D, d M Y') + '
'; + html += ``; while (isBackupOnDay(backup, currentDay)) { html += '';
${Ext.Date.format(date, 'D, d M Y')}
'; let text = Ext.Date.format(backup.data.backuptime, 'H:i'); if (backup.data.mark === 'remove') { - html += '
' + text + '
'; + html += `${text}`; } else { - text += ' (' + backup.data.keepName + ')'; + text += ` (${backup.data.keepName})`; if (me.useColors) { let bgColor = COLORS[backup.data.keepName]; let textColor = TEXT_COLORS[backup.data.keepName]; - html += '
' + text + '
'; + html += `${text}`; } else { - html += '
' + text + '
'; + html += `${text}`; } } html += '