Enhancements
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<style>
|
||||
table {border: medium solid #6495ed;border-collapse: collapse;width: 100%;}
|
||||
th{font-family: monospace;border: thin solid #6495ed;padding: 5px;background-color: #D0E3FA;text-align: left;}
|
||||
td{font-family: sans-serif;border: thin solid #6495ed;padding: 5px;text-align: center;}
|
||||
img{padding:5px; border:solid; border-color: #dddddd #aaaaaa #aaaaaa #dddddd; border-width: 1px 2px 2px 1px; background-color:white;}
|
||||
|
||||
tr.unpaid-both { background-color: #ff9999 !important; }
|
||||
tr.unpaid-either{ background-color: #ffcccc !important; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function formatAustrianDate(isoDate) {
|
||||
if (!isoDate || isoDate === ' ' || isoDate.trim() === '') return '';
|
||||
|
||||
const date = new Date(isoDate);
|
||||
if (isNaN(date.getTime())) return isoDate; // Invalid date
|
||||
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const year = date.getFullYear();
|
||||
|
||||
return `${day}.${month}.${year}`;
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const rows = document.querySelectorAll('table tr');
|
||||
|
||||
rows.forEach((row, index) => {
|
||||
if (index === 0) return; // Skip header
|
||||
|
||||
const cells = row.querySelectorAll('td');
|
||||
if (cells.length < 11) return;
|
||||
|
||||
// Format membership_start (column 7) as DD.MM.YYYY
|
||||
const startCell = cells[7];
|
||||
const originalText = startCell.textContent.trim();
|
||||
const formattedDate = formatAustrianDate(originalText);
|
||||
if (formattedDate && formattedDate !== originalText) {
|
||||
startCell.textContent = formattedDate;
|
||||
}
|
||||
|
||||
// Payment coloring logic (unchanged)
|
||||
const startText = formattedDate || originalText;
|
||||
const year2024 = cells[9].textContent.trim();
|
||||
const year2025 = cells[10].textContent.trim();
|
||||
|
||||
const paid2024 = year2024 === 'X';
|
||||
const paid2025 = year2025 === 'X';
|
||||
const started2025 = startText.includes('2025');
|
||||
|
||||
if (started2025 && paid2025) return;
|
||||
|
||||
if (!paid2024 && !paid2025) {
|
||||
row.classList.add('unpaid-both');
|
||||
} else if (!paid2024 || !paid2025) {
|
||||
row.classList.add('unpaid-either');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
Reference in New Issue
Block a user