Filter
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
|
||||
<div class="fixed top-0 left-0 right-0 bg-white p-4 shadow z-10">
|
||||
<div class="flex justify-between items-center">
|
||||
<DatePicker bind:isOpen bind:startDate={startdatum} bind:endDate={enddatum} isRange={true} onDateChange={onChange} isMultipane={true}>
|
||||
<DatePicker bind:isOpen bind:startDate={startdatum} bind:endDate={enddatum} enableFutureDates={false} isRange={true} onDateChange={onChange} isMultipane={true}>
|
||||
<input type="text" class="w-min" readonly value={`${formatiertesStartDatum} - ${formatiertesEndDatum}`} on:click={toggleDatePicker} />
|
||||
</DatePicker>
|
||||
<p>Abrechnungsübersicht für <strong>{email}</strong></p>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user