diff --git a/app/Form/Models/Form.php b/app/Form/Models/Form.php index 627b594e..21096be5 100644 --- a/app/Form/Models/Form.php +++ b/app/Form/Models/Form.php @@ -190,6 +190,18 @@ class Form extends Model implements HasMedia return Sorting::from($this->meta['sorting']); } + public function isInDates(): bool { + if ($this->registration_from && $this->registration_from->gt(now())) { + return false; + } + + if ($this->registration_until && $this->registration_until->lt(now())) { + return false; + } + + return true; + } + public function canRegister(): bool { if (!$this->is_active) { diff --git a/app/Form/Resources/FormResource.php b/app/Form/Resources/FormResource.php index f4b0cfaf..5a0f3abc 100644 --- a/app/Form/Resources/FormResource.php +++ b/app/Form/Resources/FormResource.php @@ -46,6 +46,7 @@ class FormResource extends JsonResource 'mail_bottom' => $this->mail_bottom, 'registration_from' => $this->registration_from?->format('Y-m-d H:i:s'), 'registration_until' => $this->registration_until?->format('Y-m-d H:i:s'), + 'is_in_dates' => $this->isInDates(), 'config' => $this->config, 'participants_count' => $this->participants_count, 'is_active' => $this->is_active, diff --git a/resources/js/views/form/Index.vue b/resources/js/views/form/Index.vue index 95089c51..d293cae7 100644 --- a/resources/js/views/form/Index.vue +++ b/resources/js/views/form/Index.vue @@ -146,6 +146,7 @@ Name Von Bis + Tags Anzahl TN @@ -162,6 +163,13 @@
+ +
+ A + P + D +
+