feat: show change timestamps in history compare
This commit is contained in:
@@ -862,6 +862,10 @@ body {
|
||||
width: 82px;
|
||||
}
|
||||
|
||||
.col-compare-date {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.col-compare-category {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
@@ -1479,6 +1479,23 @@ function getListSearchEntries() {
|
||||
}));
|
||||
}
|
||||
|
||||
function formatCompareChangedAt(value) {
|
||||
const raw = String(value || '').trim();
|
||||
if (!raw) {
|
||||
return '-';
|
||||
}
|
||||
const date = new Date(raw);
|
||||
if (Number.isNaN(date.getTime())) {
|
||||
return raw;
|
||||
}
|
||||
const year = date.getFullYear();
|
||||
const month = pad(date.getMonth() + 1);
|
||||
const day = pad(date.getDate());
|
||||
const hours = pad(date.getHours());
|
||||
const minutes = pad(date.getMinutes());
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
function renderListViewCompareTable() {
|
||||
const container = document.getElementById('list-table-container');
|
||||
if (!container) {
|
||||
@@ -1492,6 +1509,7 @@ function renderListViewCompareTable() {
|
||||
<tr>
|
||||
<th class="col-name">이름</th>
|
||||
<th class="col-compare-status">상태</th>
|
||||
<th class="col-compare-date">변경일시</th>
|
||||
<th class="col-compare-category">변경유형</th>
|
||||
<th>이전</th>
|
||||
<th>현재</th>
|
||||
@@ -1501,7 +1519,7 @@ function renderListViewCompareTable() {
|
||||
`;
|
||||
|
||||
if (!rows.length) {
|
||||
html += '<tr><td colspan="5" class="list-empty-cell">선택한 기간 사이의 구성원 변경 내역이 없습니다.</td></tr>';
|
||||
html += '<tr><td colspan="6" class="list-empty-cell">선택한 기간 사이의 구성원 변경 내역이 없습니다.</td></tr>';
|
||||
} else {
|
||||
rows.forEach((item) => {
|
||||
const categories = (item.categories || []).map((category) => `<span class="list-compare-chip">${escapeHtml(category)}</span>`).join('');
|
||||
@@ -1511,6 +1529,7 @@ function renderListViewCompareTable() {
|
||||
<tr id="list-compare-row-${item.member_id}">
|
||||
<td class="font-black text-slate-700">${escapeHtml(item.name || '-')}</td>
|
||||
<td><span class="list-compare-status list-compare-status-${escapeHtml(item.status || 'updated')}">${escapeHtml(item.status_label || '-')}</span></td>
|
||||
<td>${escapeHtml(formatCompareChangedAt(item.changed_at))}</td>
|
||||
<td><div class="list-compare-chip-group">${categories || '<span class="text-slate-300">-</span>'}</div></td>
|
||||
<td class="list-compare-cell">${beforeLines}</td>
|
||||
<td class="list-compare-cell">${afterLines}</td>
|
||||
|
||||
Reference in New Issue
Block a user