This commit is contained in:
Pranshu Tomar 2020-03-23 18:01:06 +05:30
parent 45b6849006
commit c181ef7ec8
4 changed files with 4 additions and 7 deletions

View File

@ -270,8 +270,7 @@ class Booking
? $bookingProductSlot->slots
: ($bookingProductSlot->slots[$requestedDate->format('w')] ?? []);
if ($requestedDate < $currentTime
|| $requestedDate < $availableFrom
if ($requestedDate < $availableFrom
|| $requestedDate > $availableTo
) {
return [];

View File

@ -38,8 +38,7 @@ class DefaultSlot extends Booking
? Carbon::createFromTimeString($bookingProduct->available_to)
: Carbon::createFromTimeString('2080-01-01 00:00:00');
if ($requestedDate < $currentTime
|| $requestedDate < $availableFrom
if ($requestedDate < $availableFrom
|| $requestedDate > $availableTo
) {
return [];

View File

@ -39,8 +39,7 @@ class RentalSlot extends Booking
? $bookingProductSlot->slots
: $bookingProductSlot->slots[$requestedDate->format('w')];
if ($requestedDate < $currentTime
|| $requestedDate < $availableFrom
if ($requestedDate < $availableFrom
|| $requestedDate > $availableTo
) {
return [];

View File

@ -61,7 +61,7 @@
<label class="required">{{ __('bookingproduct::app.admin.catalog.products.available-from') }}</label>
<datetime>
<input type="text" v-validate="'required|date_format:yyyy-MM-dd HH:mm:ss|after:{{\Carbon\Carbon::now()}}'" name="booking[available_from]" v-model="booking.available_from" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.available-from') }}&quot;" ref="available_from"/>
<input type="text" v-validate="'required|date_format:yyyy-MM-dd HH:mm:ss|after:{{\Carbon\Carbon::yesterday()->format('Y-m-d 23:59:59')}}'" name="booking[available_from]" v-model="booking.available_from" class="control" data-vv-as="&quot;{{ __('bookingproduct::app.admin.catalog.products.available-from') }}&quot;" ref="available_from"/>
</datetime>
<span class="control-error" v-if="errors.has('booking[available_from]')">@{{ errors.first('booking[available_from]') }}</span>