2
0
forked from jmug/cactoide

fix: creating an event and showing the wrong date

This commit is contained in:
Levente Orban
2025-10-20 11:25:35 +02:00
parent c340088434
commit 9b1ef64618
5 changed files with 37 additions and 15 deletions

View File

@@ -86,8 +86,9 @@ export const actions: Actions = {
});
}
// Check if date is in the past (but allow editing past events for corrections)
const eventDate = new Date(date);
// Check if date is in the past using local timezone (but allow editing past events for corrections)
const [year, month, day] = date.split('-').map(Number);
const eventDate = new Date(year, month - 1, day);
const today = new Date();
today.setHours(0, 0, 0, 0);