Update event management system by adding Uhrzeit to Termine; enhance data handling in API and CSV exports to accommodate new fields. Refactor Termine component for improved date and time formatting, ensuring accurate display of events. Clean up unused code in MannschaftenUebersicht and streamline layout in Mannschaften index page for better user experience.

This commit is contained in:
Torsten Schulz (local)
2025-11-05 13:22:57 +01:00
parent d6d9a31669
commit bc2f59bd1a
35 changed files with 653 additions and 929 deletions

View File

@@ -15,7 +15,16 @@ import 'crypto';
const newsPublic_get = defineEventHandler(async (event) => {
try {
const allNews = await readNews();
const publicNews = allNews.filter((item) => item.isPublic === true);
const now = /* @__PURE__ */ new Date();
const publicNews = allNews.filter((item) => {
if (!item.isPublic) return false;
if (item.isHidden) return false;
if (item.expiresAt) {
const expiresAt = new Date(item.expiresAt);
if (expiresAt <= now) return false;
}
return true;
});
publicNews.sort((a, b) => new Date(b.created) - new Date(a.created));
const latestNews = publicNews.slice(0, 3);
return {