Fix category dates: ensure endAt is after startAt, use event.startAt as default end
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,8 @@ class Category
|
||||
$this->event = $event;
|
||||
|
||||
if ($event && $event->getStartAt()) {
|
||||
$this->endAt = $event->getStartAt()->modify('-1 day');
|
||||
$endCandidate = $event->getStartAt()->modify('-1 day');
|
||||
$this->endAt = $endCandidate > $this->startAt ? $endCandidate : $event->getStartAt();
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<label for="cat_end" class="text-xs font-black uppercase tracking-widest form-label">Fin vente</label>
|
||||
<input type="datetime-local" id="cat_end" name="end_at" class="form-input focus:border-indigo-600" value="{{ event.startAt|date_modify('-1 day')|date('Y-m-d\\TH:i') }}">
|
||||
<input type="datetime-local" id="cat_end" name="end_at" class="form-input focus:border-indigo-600" value="{{ event.startAt|date('Y-m-d\\TH:i') }}">
|
||||
</div>
|
||||
<button type="submit" class="btn-brutal font-black uppercase text-xs tracking-widest hover:bg-indigo-600 hover:text-white transition-all">
|
||||
+ Ajouter
|
||||
|
||||
Reference in New Issue
Block a user