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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user