This commit is contained in:
Moritz Utcke
2025-08-05 10:56:55 -04:00
parent 4df30004de
commit 811d574576
3 changed files with 12 additions and 1 deletions

View File

@@ -15,6 +15,12 @@ const end = moment(Astro.url.searchParams.get("end"));
let startdatum = start.isValid() ? start.toDate() : moment().startOf("month").toDate();
let enddatum = end.isValid() ? end.toDate() : moment().endOf("month").toDate();
// Wir dürfen die Abrechnung erst ab Juni starten lassen.
if (startdatum < moment().set("year", 2025).set("month", 5).set("date", 1).toDate()) {
startdatum = moment().set("year", 2025).set("month", 5).set("date", 1).toDate();
enddatum = moment().set("year", 2025).set("month", 5).set("date", 1).endOf("month").toDate();
}
const benutzer = await getCurrentUser(Astro);
if (!benutzer) {

View File

@@ -11,6 +11,11 @@ import { getProvision } from "#lib/provision";
const datum = moment(Astro.url.searchParams.get("d"));
const benutzer = await getCurrentUser(Astro);
// Wir dürfen die Abrechnung erst ab Juni starten lassen.
if (datum.isBefore(moment().set("year", 2025).set("month", 5).set("date", 1))) {
return Astro.redirect("/404")
}
if (!benutzer) {
return Astro.redirect("/404");
}