diff --git a/functions/api/events-team/events/[id].ts b/functions/api/events-team/events/[id].ts index 5836788..df3fac9 100644 --- a/functions/api/events-team/events/[id].ts +++ b/functions/api/events-team/events/[id].ts @@ -74,6 +74,9 @@ export async function onRequestPatch(context: RequestContext) { const date = new Date(); const currentDay = date.getUTCDate(); + // Set to first of month to avoid any issues with month incrementation, then add month and subtract one day to get the last day of this month + date.setUTCDate(1); + date.setUTCMonth(date.getUTCMonth() + 1); date.setUTCDate(0); if (