Style update
This commit is contained in:
parent
c6e206ffe7
commit
aa2ecc44e6
2 changed files with 10 additions and 4 deletions
10
app.js
10
app.js
|
|
@ -368,7 +368,7 @@ function renderEntries() {
|
|||
const source = sourceLabels[entry.source] || entry.source;
|
||||
return `
|
||||
<tr class="${isPastEntry(entry) ? 'past-entry' : ''}">
|
||||
<td><strong>${escapeHtml(entry.title)}</strong> <span class="muted">${escapeHtml(source)}</span><br><span class="muted entry-date">${escapeHtml(entry.start_date)} → ${escapeHtml(entry.end_date)}</span>${Number(entry.allow_unpaid) ? ' <span class="pill unpaid">unpaid</span>' : ''}</td>
|
||||
<td><strong>${escapeHtml(entry.title)}</strong> <span class="muted">${escapeHtml(source)}</span><br><span class="muted entry-date">${formatDate(entry.start_date)} → ${formatDate(entry.end_date)}</span>${Number(entry.allow_unpaid) ? ' <span class="pill unpaid">unpaid</span>' : ''}</td>
|
||||
<td class="num strong-num">${days(summary.workdays)}</td>
|
||||
<td class="num">${days(summary.usedVacation)}</td>
|
||||
<td class="num">${days(summary.usedFeriefridage)}</td>
|
||||
|
|
@ -427,7 +427,7 @@ function renderMonthRow(month) {
|
|||
<span class="month-entry">
|
||||
<strong>${escapeHtml(item.title)}</strong>
|
||||
<small class="planner-entry-meta"><strong>${days(item.workdays)} wd</strong> · ${days(item.usedVacation)} vd · ${days(item.usedFeriefridage)} ff · ${hours(item.usedFlex)} fl</small>
|
||||
<small class="planner-entry-dates">${escapeHtml(item.start_date)} → ${escapeHtml(item.end_date)}</small>
|
||||
<small class="planner-entry-dates">${formatDate(item.start_date)} → ${formatDate(item.end_date)}</small>
|
||||
</span>
|
||||
`).join('')
|
||||
: '<span class="muted">—</span>';
|
||||
|
|
@ -866,6 +866,12 @@ function parseDate(value) {
|
|||
return dateFromParts(year, month, day);
|
||||
}
|
||||
|
||||
function formatDate(value) {
|
||||
const [year, month, day] = String(value).split('-');
|
||||
if (!year || !month || !day) return escapeHtml(value);
|
||||
return `${day}/${month}/${year}`;
|
||||
}
|
||||
|
||||
function monthKey(year, month) {
|
||||
return `${year}-${String(month).padStart(2, '0')}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue