statt Moment nun luxon verwendet

This commit is contained in:
rxf
2025-07-27 13:46:34 +02:00
parent 7300a46cb2
commit d51aa4a6c8
3 changed files with 16 additions and 11 deletions

View File

@@ -66,8 +66,11 @@ h5 {
margin-top: 1em;
}
#tabAnmeld {
margin-left: 10%;
}
#tabAnmeld, #tnames {
margin-left: 10%;
width: 100%;
border-collapse: collapse;
}

View File

@@ -74,7 +74,7 @@ if ($typ == 'regular') {
</div>
<!-- Scripts -->
<script src="https://cdn.jsdelivr.net/npm/moment@2.29.4/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luxon@3.7.1/build/global/luxon.min.js"></script>
<script src="js/version.js" defer></script>
<script src="js/anmeld.js" defer></script>

View File

@@ -50,6 +50,8 @@ Beobachtergruppe Sternwarte Welzheim`,
let abgesagt = false;
let actualdate;
let isSmallScreen = false
let DateTime = luxon.DateTime
function $(selector) {
return document.querySelector(selector);
@@ -205,7 +207,7 @@ Beobachtergruppe Sternwarte Welzheim`,
<tr>
<td class="tdname col-6">${x.name} ${x.vorname}</td>
<td class="col-2">${x.anzahl}</td>
<td class="col-2">${moment(x.fdatum).format('YYYY-MM-DD')}</td>
<td class="col-2">${DateTime.fromISO(x.fdatum).toFormat('yyyy-LL-dd')}</td>
<td class="tdfind col-2"><button type="button" class="findit" value="${x.id}">🔍</button></td>
</tr>`);
}
@@ -313,7 +315,7 @@ Beobachtergruppe Sternwarte Welzheim`,
<th class="col-2">Name</th>
<th class="col-2">Vorname</th>
<th class="col-3">Email</th>
<th class="col-1">Anzahl</th>
<th class="col-1">Anz</th>
<th class="col-2">Datum</th>
<th class="col-2">Anmeldung</th>
</tr></thead><tbody>`);
@@ -326,8 +328,8 @@ Beobachtergruppe Sternwarte Welzheim`,
<td class="tdname col-2">${x.vorname}</td>
<td class="tdname col-3">${x.email}</td>
<td class="col-1">${x.anzahl}</td>
<td class="col-2">${moment(x.fdatum).format('YYYY-MM-DD')}</td>
<td class="col-2">${moment(x.angemeldet).format('YYYY-MM-DD')}</td>
<td class="col-2">${DateTime.fromISO(x.fdatum).toFormat('yyyy-LL-dd')}</td>
<td class="col-2">${DateTime.fromISO(x.angemeldet).toFormat('yyyy-LL-dd')}</td>
</tr>`);
}
@@ -378,12 +380,12 @@ Beobachtergruppe Sternwarte Welzheim`,
let summ = 0;
let select = `<select name='ftermin' id='ftermin'>`;
let selectedNext = false;
const today = moment().startOf('day');
const today = DateTime.now().startOf('day');
for (let d of dates) {
let isselected = "";
const fday = moment(d.datum);
if (!selectedNext && fday.isSameOrAfter(today)) {
const fday = DateTime.fromISO(d.datum);
if (!selectedNext && (isSameorAfter = fday >= today)) {
selectedNext = true;
isselected = "selected";
n = i;
@@ -427,7 +429,7 @@ Beobachtergruppe Sternwarte Welzheim`,
async function main(n) {
let index = 0
const today = moment().subtract(14, 'days').format("YYYYMMDD");
const today = DateTime.now().minus({ days: 14 }).toFormat("yyyyLLdd");
const dates = await fetchFromDbase({cmd:'GET_DATES', anzahl:n, date: today});
const last = await fetchFromDbase({cmd:'GET_LASTANMELDUNG', date: today});
@@ -448,7 +450,7 @@ Beobachtergruppe Sternwarte Welzheim`,
await findName(query.name);
}
if (query.double) {
await showDoubles(moment().format("YYYYMMDD"));
await showDoubles(DateTime.now().toFormat("yyyyLLdd"));
}
}