feat: add Jalali Calendar in flight create and edit for user side

This commit is contained in:
2026-08-20 08:39:08 -07:00
parent 5cbbb11ee6
commit 303dc2d686
4 changed files with 14 additions and 6 deletions
@@ -107,6 +107,7 @@ class FlightController extends Controller
'departure_time' => [ 'departure_time' => [
'required', 'required',
'date', 'date',
'after_or_equal:today',
], ],
'departure_airport_id' => [ 'departure_airport_id' => [
@@ -201,7 +202,7 @@ class FlightController extends Controller
return redirect() return redirect()
->route('admin.flights.index') ->route('admin.flights.index')
->with('success', 'پرواز با موفقیت ایجاد شد'); ->withErrors(['success' => 'پرواز با موفقیت ایجاد شد']);
} }
public function edit(Flight $flight) public function edit(Flight $flight)
@@ -252,6 +253,7 @@ class FlightController extends Controller
'departure_time' => [ 'departure_time' => [
'required', 'required',
'date', 'date',
'after_or_equal:today',
], ],
'departure_airport_id' => [ 'departure_airport_id' => [
@@ -345,7 +347,7 @@ class FlightController extends Controller
return redirect() return redirect()
->route('admin.flights.index') ->route('admin.flights.index')
->with('success', 'پرواز با موفقیت ویرایش شد'); ->withErrors(['success'=> 'پرواز با موفقیت ویرایش شد']);
} }
public function destroy(Flight $flight) public function destroy(Flight $flight)
@@ -353,7 +353,8 @@
time: true, time: true,
hasSecond: false, hasSecond: false,
targetValueInput: 'attr', targetValueInput: 'attr',
targetValueType: 'attr' targetValueType: 'attr',
minDate: 'today'
}); });
</script> </script>
@endsection @endsection
+2 -1
View File
@@ -345,7 +345,8 @@
time: true, time: true,
hasSecond: false, hasSecond: false,
targetValueInput: 'attr', targetValueInput: 'attr',
targetValueType: 'attr' targetValueType: 'attr',
minDate: 'today'
}); });
</script> </script>
@endsection @endsection
@@ -25,7 +25,7 @@
<span class="text-success">{{ $message }}</span> <span class="text-success">{{ $message }}</span>
@enderror @enderror
@error('$errors') @error('errors')
<span class="text-danger">{{ $message }}</span> <span class="text-danger">{{ $message }}</span>
@enderror @enderror
<div class="row"> <div class="row">
@@ -145,6 +145,7 @@
<th>ظرفیت</th> <th>ظرفیت</th>
<th>وضعیت</th> <th>وضعیت</th>
<th>تاریخ ثبت</th> <th>تاریخ ثبت</th>
<th>تاریخ ویرایش</th>
<th>عملیات</th> <th>عملیات</th>
</tr> </tr>
</thead> </thead>
@@ -250,6 +251,10 @@
{{ $flight->created_at->toJalali()->format('H:i Y-m-d') }} {{ $flight->created_at->toJalali()->format('H:i Y-m-d') }}
</td> </td>
<td>
{{ $flight->updated_at->toJalali()->format('H:i Y-m-d') }}
</td>
<td> <td>
<div class="hstack gap-2 fs-15"> <div class="hstack gap-2 fs-15">
@@ -314,4 +319,3 @@
</div> </div>
</div> </div>
@endsection @endsection