From 960b7058b8f30ea001c508d6321f99cf7b16ffac Mon Sep 17 00:00:00 2001 From: Pranshu Tomar Date: Tue, 16 Jun 2020 21:29:33 +0530 Subject: [PATCH] Issue fixed if booking product is null --- .../admin/catalog/products/accordians/booking.blade.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/Webkul/BookingProduct/src/Resources/views/admin/catalog/products/accordians/booking.blade.php b/packages/Webkul/BookingProduct/src/Resources/views/admin/catalog/products/accordians/booking.blade.php index 3c89c6852..4752f4c64 100644 --- a/packages/Webkul/BookingProduct/src/Resources/views/admin/catalog/products/accordians/booking.blade.php +++ b/packages/Webkul/BookingProduct/src/Resources/views/admin/catalog/products/accordians/booking.blade.php @@ -157,14 +157,10 @@ }, created: function() { - if (this.booking.available_from) { - this.booking.available_from = "{{ $bookingProduct->available_from->format('Y-m-d H:i:s') }}"; - } + this.booking.available_from = "{{ $bookingProduct && $bookingProduct->available_from ? $bookingProduct->available_from->format('Y-m-d H:i:s') : '' }}"; - if (this.booking.available_to) { - this.booking.available_to = "{{ $bookingProduct->available_to->format('Y-m-d H:i:s') }}"; - } + this.booking.available_to = "{{ $bookingProduct && $bookingProduct->available_to ? $bookingProduct->available_to->format('Y-m-d H:i:s') : '' }}"; } });