Fixed: The display format for max order date in case admin does not update the max order date for the hotel

This commit is contained in:
vishalsingh.qlo325
2024-05-02 11:29:12 +05:30
parent 960808ce36
commit 1822bc76f2
2 changed files with 3 additions and 3 deletions

View File

@@ -162,9 +162,9 @@ class AdminAddHotelController extends ModuleAdminController
$restrictDateInfo = HotelOrderRestrictDate::getDataByHotelId($idHotel);
if ($restrictDateInfo) {
if ($restrictDateInfo['max_order_date'] == '0000-00-00') {
$restrictDateInfo['max_order_date'] = date('d-m-Y', strtotime('1 year'));
$restrictDateInfo['max_order_date'] = date('Y-m-d', strtotime('1 year'));
} else {
$restrictDateInfo['max_order_date'] = date('d-m-Y', strtotime($restrictDateInfo['max_order_date']));
$restrictDateInfo['max_order_date'] = date('Y-m-d', strtotime($restrictDateInfo['max_order_date']));
}
}
$smartyVars['order_restrict_date_info'] = $restrictDateInfo;

View File

@@ -364,7 +364,7 @@
<label class="control-label col-sm-3 required" for="maximum_booking_date">{l s='Maximum Check-out Date to book a room :' mod='hotelreservationsystem'}</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="maximum_booking_date_formatted" name="maximum_booking_date_formatted" value="{if isset($smarty.post.maximum_booking_date_formatted)}{$smarty.post.maximum_booking_date_formatted|escape:'html':'UTF-8'}{elseif isset($edit) && isset($order_restrict_date_info.max_order_date)}{date('d-m-Y', strtotime($order_restrict_date_info.max_order_date|escape:'htmlall':'UTF-8'))}{/if}" />
<input type="hidden" name="maximum_booking_date" value=""/>
<input type="hidden" name="maximum_booking_date" value="{if isset($order_restrict_date_info.max_order_date)}{$order_restrict_date_info.max_order_date|escape:'htmlall':'UTF-8'}{/if}"/>
</div>
</div>
<div class="form-group">