git commit "fix: persianDatepicker did not initialize due to jQuery loading after content

This commit is contained in:
2026-08-20 09:05:15 +03:30
parent fa291c7108
commit 73c8e52414
16 changed files with 175 additions and 61 deletions
+17 -14
View File
@@ -111,15 +111,20 @@
</label>
<input type="text"
id="start_date"
name="start_date"
id="departure_date"
name="departure_date"
class="form-control"
placeholder="انتخاب تاریخ حرکت">
{{ verta($tour->departure_date)->format('Y/m/d') }}
readonly
autocomplete="off"
value="{{ old('departure_date', $tour->departure_date ? verta($tour->departure_date)->format('Y/m/d') : '') }}">
@error('departure_date')
<div class="text-danger mt-2">{{ $message }}</div>
@enderror
</div>
<div class="col-md-4 mb-3">
<label>وضعیت</label>
@@ -192,17 +197,15 @@
<script>
$("#start_date").persianDatepicker({
format: 'YYYY/MM/DD',
autoClose: true,
initialValue: false,
minDate: new persianDate()
window.addEventListener('load', function () {
$("#departure_date").persianDatepicker({
format: 'YYYY/MM/DD',
autoClose: true,
initialValue: false,
minDate: new persianDate()
});
});
</script>
@endsection