Merge branch 'trunk'

This commit is contained in:
Vincent BRIDIER 2026-10-28 17:44:57 +01:00
commit 3c7af56770
2 changed files with 8 additions and 4 deletions

View file

@ -2,6 +2,7 @@
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
class Calendrier extends Model
@ -54,6 +55,9 @@ class Calendrier extends Model
*/
public function isPublished(): bool
{
return now()->betweenIncluded($this->calendrier_startdate, $this->calendrier_enddate->endOfDay());
return now()->betweenIncluded(
Carbon::parse($this->calendrier_startdate),
Carbon::parse($this->calendrier_enddate)->endOfDay()
);
}
}

View file

@ -101,8 +101,8 @@
<h4><i class="fas fa-plus-square addcalendar"></i> {{ __('Calendrier de diffusion') }}</h4>
@foreach ($coupon->calendriers()->get() as $calendrier)
<div class="form-field-calendar">
<input type="date" name="startdate[]" value="{{ $calendrier->calendrier_startdate->format('Y-m-d') }}">
<input type="date" name="enddate[]" value="{{ $calendrier->calendrier_enddate->format('Y-m-d') }}">
<input type="date" name="startdate[]" value="{{ Carbon\Carbon::parse($calendrier->calendrier_startdate)->format('Y-m-d') }}">
<input type="date" name="enddate[]" value="{{ Carbon\Carbon::parse($calendrier->calendrier_enddate)->format('Y-m-d') }}">
<i class="fas fa-minus-square removecalendar"></i>
</div>
@endforeach
@ -117,7 +117,7 @@
</thead>
@foreach ($coupon->mouvements()->get() as $mouvement)
<tr>
<th>{{ $mouvement->mouvement_created_at->format('d/m/Y') }}</th>
<th>{{ Carbon\Carbon::parse($mouvement->mouvement_created_at)->format('d/m/Y') }}</th>
<th>{{ $mouvement->mouvement_nombre }}</th>
<th></th>
</tr>