diff --git a/admin/themes/default/template/controllers/orders/_overbookings.tpl b/admin/themes/default/template/controllers/orders/_overbookings.tpl
index 963b33489..5d5e90fb5 100644
--- a/admin/themes/default/template/controllers/orders/_overbookings.tpl
+++ b/admin/themes/default/template/controllers/orders/_overbookings.tpl
@@ -39,7 +39,8 @@
{$data['room_num']}
{$data['room_type_name']}
- {dateFormat date=$data['date_from']} {l s='To'} {dateFormat date=$data['date_to']}
+ {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
+ {dateFormat date=$data['date_from'] full=$is_full_date} {l s='To'} {dateFormat date=$data['date_to'] full=$is_full_date}
{if $order->with_occupancy && $data['children']}
diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl
index c697a8b6f..1e44a648f 100644
--- a/admin/themes/default/template/controllers/orders/_product_line.tpl
+++ b/admin/themes/default/template/controllers/orders/_product_line.tpl
@@ -35,7 +35,8 @@
{$data.room_type}
- {dateFormat date=$data.date_from} - {dateFormat date=$data.date_to}
+ {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
+ {dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date}
{if $data['children']}
diff --git a/admin/themes/default/template/controllers/orders/_resolvable_overbookings.tpl b/admin/themes/default/template/controllers/orders/_resolvable_overbookings.tpl
index b2f5cba79..30057260c 100644
--- a/admin/themes/default/template/controllers/orders/_resolvable_overbookings.tpl
+++ b/admin/themes/default/template/controllers/orders/_resolvable_overbookings.tpl
@@ -55,7 +55,8 @@
{$data['hotel_name']}
- {dateFormat date=$data['date_from']|escape:'html':'UTF-8'} {l s='To'} {dateFormat date=$data['date_to']|escape:'html':'UTF-8'}
+ {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
+ {dateFormat date=$data['date_from']|escape:'html':'UTF-8' full=$is_full_date} {l s='To'} {dateFormat date=$data['date_to']|escape:'html':'UTF-8' full=$is_full_date}
#{$data['id_order']|escape:'html':'UTF-8'}
diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
index 7a0554fbc..d2a660045 100644
--- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
+++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl
@@ -115,7 +115,8 @@
{$data['room_type_name']|escape:'html':'UTF-8'}
- {dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']}
+ {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
+ {dateFormat date=$data['date_from'] full=$is_full_date} - {dateFormat date=$data['date_to'] full=$is_full_date}
{if ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']) || ($data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status'])}
diff --git a/admin/themes/default/template/controllers/orders/modals/_cancel_room_bookings.tpl b/admin/themes/default/template/controllers/orders/modals/_cancel_room_bookings.tpl
index 5fbe2f90d..a3ee9d651 100644
--- a/admin/themes/default/template/controllers/orders/modals/_cancel_room_bookings.tpl
+++ b/admin/themes/default/template/controllers/orders/modals/_cancel_room_bookings.tpl
@@ -42,7 +42,8 @@
{$bookingInfo.room_num|escape:'html':'UTF-8'}
{$bookingInfo.room_type_name|escape:'html':'UTF-8'}
{$bookingInfo.hotel_name|escape:'html':'UTF-8'}
- {dateFormat date=$bookingInfo.date_from} - {dateFormat date=$bookingInfo.date_to}
+ {assign var="is_full_date" value=($show_full_date && ($bookingInfo['date_from']|date_format:'%D' == $bookingInfo['date_to']|date_format:'%D'))}
+ {dateFormat date=$bookingInfo.date_from full=$is_full_date} - {dateFormat date=$bookingInfo.date_to full=$is_full_date}
{convertPriceWithCurrency price=$bookingInfo.total_price_tax_incl currency=$currency->id}
{/foreach}
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php
index 670f3e64a..405797c38 100644
--- a/classes/controller/AdminController.php
+++ b/classes/controller/AdminController.php
@@ -2172,7 +2172,7 @@ public function initHeader()
'currentIndex' => self::$currentIndex,
'bootstrap' => $this->bootstrap,
'default_language' => (int)Configuration::get('PS_LANG_DEFAULT'),
- 'display_addons_connection' => Tab::checkTabRights(Tab::getIdFromClassName('AdminModulesController'))
+ 'display_addons_connection' => Tab::checkTabRights(Tab::getIdFromClassName('AdminModulesController')),
));
$module = Module::getInstanceByName('themeconfigurator');
@@ -2951,7 +2951,8 @@ public function init()
'token' => $this->token,
'host_mode' => defined('_PS_HOST_MODE_') ? 1 : 0,
'stock_management' => (int)Configuration::get('PS_STOCK_MANAGEMENT'),
- 'language_is_rtl' => $this->context->language->is_rtl
+ 'language_is_rtl' => $this->context->language->is_rtl,
+ 'show_full_date' => $this->show_full_date,
));
if ($this->display_header) {
diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php
index a21ca409c..e9628c6a8 100644
--- a/classes/controller/Controller.php
+++ b/classes/controller/Controller.php
@@ -78,6 +78,8 @@ abstract class ControllerCore
/** @var string Controller name */
public $php_self;
+ public $show_full_date = false;
+
/**
* Check if the controller is available for the current user/visitor
*/
diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php
index c3d116e54..d72120cc6 100644
--- a/classes/controller/FrontController.php
+++ b/classes/controller/FrontController.php
@@ -496,6 +496,7 @@ public function init()
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
+ 'show_full_date' => $this->show_full_date
));
// Add the tpl files directory for mobile
@@ -596,7 +597,7 @@ public function initContent()
'HOOK_TOP' => Hook::exec('displayTop'),
'HOOK_LEFT_COLUMN' => ($this->display_column_left ? Hook::exec('displayLeftColumn') : ''),
'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
- 'show_breadcrump' => $this->show_breadcrump, // By webkul
+ 'show_breadcrump' => $this->show_breadcrump,
));
} else {
$this->context->smarty->assign('HOOK_MOBILE_HEADER', Hook::exec('displayMobileHeader'));
diff --git a/classes/module/Module.php b/classes/module/Module.php
index 5dd18e9d6..eee3a4a67 100644
--- a/classes/module/Module.php
+++ b/classes/module/Module.php
@@ -2880,9 +2880,11 @@ public function getOverrides()
} elseif (Module::getModuleIdByName($class)) {
$classInfo['type'] = self::OVERRIDE_TYPE_MODULE;
} elseif (preg_match('#^modules/([a-zA-Z0-9_-]+)/controllers/(admin|front)/([0-9a-zA-Z-_]+).php#', $file, $matches)) {
- $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER;
- $classInfo['module'] = $matches[1];
- $classInfo['controller_type'] = $matches[2];
+ if ($class != 'index') {
+ $classInfo['type'] = self::OVERRIDE_TYPE_MODULE_CONTROLLER;
+ $classInfo['module'] = $matches[1];
+ $classInfo['controller_type'] = $matches[2];
+ }
}
if ($classInfo['type']) {
diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php
index 75d696ffd..118acabc8 100644
--- a/classes/pdf/HTMLTemplateInvoice.php
+++ b/classes/pdf/HTMLTemplateInvoice.php
@@ -475,8 +475,9 @@ public function getContent()
$num_days = $obj_htl_bk_dtl->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
- $cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = Tools::displayDate($data_v['date_from']);
- $cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = Tools::displayDate($data_v['date_to']);
+ $fullDate = ($this->context->controller->show_full_date && (date('Y-m-d', strtotime($data_v['date_from'])) == date('Y-m-d', strtotime($data_v['date_to']))) ? true : false);
+ $cart_htl_data[$type_key]['date_diff'][$date_join]['data_form'] = Tools::displayDate($data_v['date_from'], null, $fullDate);
+ $cart_htl_data[$type_key]['date_diff'][$date_join]['data_to'] = Tools::displayDate($data_v['date_to'], null, $fullDate);
$cart_htl_data[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$cart_htl_data[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
$cart_htl_data[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js
index 9dfd93abd..c3516e755 100644
--- a/modules/blockcart/ajax-cart.js
+++ b/modules/blockcart/ajax-cart.js
@@ -122,7 +122,8 @@ $(document).ready(function() {
//JS Object : update the cart by ajax actions
var ajaxCart = {
- dateFormat: 'dd-mm-yy',
+ dateFormat: 'DD-MM-YYYY',
+ dateFormatFull: 'DD-MM-YYYY HH:mm:ss',
nb_total_products: 0,
//override every button in the page in relation to the cart
overrideButtonsInThePage: function() {
@@ -928,8 +929,11 @@ var ajaxCart = {
if (this.bookingData.date_diff !== 'undefined') {
$.each(this.bookingData.date_diff, function(date_diff_k, date_diff_v) {
+ from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form));
+ to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to));
+ let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
content += '
';
- content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + ' ';
+ content += '' + moment(new Date(date_diff_v.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v.data_to)).format(dateFormatToUse) + ' ';
content += '' + date_diff_v.num_rm + ' ';
content += '' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + ' ';
content += '';
@@ -965,8 +969,11 @@ var ajaxCart = {
var product_price_float = this.price_float;
if (this.bookingData.date_diff !== 'undefined') {
$.each(this.bookingData.date_diff, function(date_diff_k1, date_diff_v1) {
+ from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form));
+ to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to));
+ let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
booking_dates_content += ' ';
- booking_dates_content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + ' ';
+ booking_dates_content += '' + moment(new Date(date_diff_v1.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v1.data_to)).format(dateFormatToUse) + ' ';
booking_dates_content += '' + date_diff_v1.num_rm + ' ';
booking_dates_content += '' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + ' ';
booking_dates_content += '';
diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php
index db92cb01d..eb4edfc71 100644
--- a/modules/blockcart/blockcart.php
+++ b/modules/blockcart/blockcart.php
@@ -248,8 +248,9 @@ public function getContentVars($params)
} else {
$addedProduct['price'] = Tools::displayPrice($price['total_price_tax_incl']);
}
- $addedProduct['date_from'] = Tools::displayDate($addedProduct['date_from']);
- $addedProduct['date_to'] = Tools::displayDate($addedProduct['date_to']);
+ $fullDate = ($this->context->controller->show_full_date && (date('Y-m-d', strtotime($addedProduct['date_from'])) == date('Y-m-d', strtotime($addedProduct['date_to']))) ? true : false);
+ $addedProduct['date_from'] = Tools::displayDate($addedProduct['date_from'], null, $fullDate);
+ $addedProduct['date_to'] = Tools::displayDate($addedProduct['date_to'], null, $fullDate);
} else {
// @todo get price of added product from front
$addedProduct['price'] = ProductCore::getPriceStatic(
diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl
index bfce85de7..4025fbcf7 100644
--- a/modules/blockcart/blockcart.tpl
+++ b/modules/blockcart/blockcart.tpl
@@ -133,8 +133,9 @@
{foreach from=$product.bookingData['date_diff'] key=data_k1 item=data_v}
+ {assign var="is_full_date" value=($show_full_date && ($data_v['data_form']|date_format:'%D' == $data_v['data_to']|date_format:'%D'))}
- {$data_v['data_form']|date_format:"%d-%m-%Y"} - {$data_v['data_to']|date_format:"%d-%m-%Y"}
+ {dateFormat date=$data_v['data_form'] full=$is_full_date} - {dateFormat date=$data_v['data_to'] full=$is_full_date}
{$data_v['num_rm']}
{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}
diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php
index 30310cb9d..4680baed2 100644
--- a/modules/hotelreservationsystem/classes/HotelHelper.php
+++ b/modules/hotelreservationsystem/classes/HotelHelper.php
@@ -2511,6 +2511,13 @@ public static function validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)
$isValid = false;
}
+ Hook::exec('actionValidateDateRangeForHotel', array(
+ 'is_valid' => &$isValid,
+ 'date_from' => $dateFrom,
+ 'date_to' => $dateTo,
+ 'id_hotel' => $idHotel
+ ));
+
return $isValid;
}
diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-cart.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-cart.tpl
index e32b07ce1..d0507dfad 100644
--- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-cart.tpl
+++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-cart.tpl
@@ -26,7 +26,8 @@
{$cart_data['room_num']|escape:'htmlall':'UTF-8'}
{$cart_data['room_type']|escape:'htmlall':'UTF-8'}
- {dateFormat date=$cart_data['date_from']} - {dateFormat date=$cart_data['date_to']}
+ {assign var="is_full_date" value=($show_full_date && ($cart_data['date_from']|date_format:'%D' == $cart_data['date_to']|date_format:'%D'))}
+ {dateFormat date=$cart_data['date_from'] full=$is_full_date} - {dateFormat date=$cart_data['date_to'] full=$is_full_date}
{convertPrice price=($cart_data['amt_with_qty'] + $cart_data['additional_services_auto_add_with_room_price'] + $cart_data['additional_service_price'] + $cart_data['demand_price'])}
diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
index fdd59ea80..7c68db350 100644
--- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
+++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl
@@ -41,7 +41,8 @@
{foreach from=$book_v['data']['available'] key=avai_k item=avai_v}
{$avai_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$avai_v type='available'}
- {dateFormat date=$date_from} - {dateFormat date=$date_to}
+ {assign var="is_full_date" value=($show_full_date && ($date_from|date_format:'%D' == $date_to|date_format:'%D'))}
+ {dateFormat date=$date_from full=$is_full_date} - {dateFormat date=$date_to full=$is_full_date}
{$avai_v['room_comment']|escape:'htmlall':'UTF-8'}
{foreach $allotment_types as $allotment_type}
@@ -99,7 +100,7 @@
{/if}
- {l s='Add To Cart' mod='hotelreservationsystem'}
+ {l s='Add To Cart' mod='hotelreservationsystem'}
{/foreach}
@@ -126,8 +127,9 @@
{foreach from=$part_v['rooms'] key=sub_part_k item=sub_part_v}
{if $sub_part_v@first}
+ {assign var="is_full_date" value=($show_full_date && ($part_v['date_from']|date_format:'%D' == $part_v['date_to']|date_format:'%D'))}
- {dateFormat date=$part_v['date_from']} - {dateFormat date=$part_v['date_to']}
+ {dateFormat date=$part_v['date_from'] full=$is_full_date} - {dateFormat date=$part_v['date_to'] full=$is_full_date}
{/if}
{$sub_part_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$sub_part_v type='partially_available'}
@@ -187,7 +189,7 @@
{/if}
- {l s='Add To Cart' mod='hotelreservationsystem'}
+ {l s='Add To Cart' mod='hotelreservationsystem'}
{/foreach}
@@ -213,10 +215,11 @@
{foreach from=$book_v['data']['booked'] key=booked_k item=booked_v}
{foreach from=$booked_v['detail'] key=rm_dtl_k item=rm_dtl_v}
+ {assign var="is_full_date" value=($show_full_date && ($rm_dtl_v['date_from']|date_format:'%D' == $rm_dtl_v['date_to']|date_format:'%D'))}
{if $rm_dtl_v@first}
{$booked_v['room_num']|escape:'htmlall':'UTF-8'} {hook h='displayRoomNumAfter' data=$booked_v key=$rm_dtl_k type='booked'}
{/if}
- {dateFormat date=$rm_dtl_v['date_from']} - {dateFormat date=$rm_dtl_v['date_to']}
+ {dateFormat date=$rm_dtl_v['date_from'] full=$is_full_date} - {dateFormat date=$rm_dtl_v['date_to'] full=$is_full_date}
#{$rm_dtl_v['id_order']}
{$rm_dtl_v['comment']|escape:'htmlall':'UTF-8'}
diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl
index ea4f1328a..efa12371a 100644
--- a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl
+++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl
@@ -147,7 +147,8 @@
{$booking['room_num']|escape:'htmlall':'UTF-8'}
{$booking['room_type_name']|escape:'htmlall':'UTF-8'}
{$booking['hotel_name']|escape:'htmlall':'UTF-8'}
- {$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To' mod='hotelreservationsystem'} {$booking['date_to']|date_format:"%d-%m-%Y"}
+ {assign var="is_full_date" value=($show_full_date && ($booking['date_from']|date_format:'%D' == $booking['date_to']|date_format:'%D'))}
+ {dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To' mod='hotelreservationsystem'} {dateFormat date=$booking['date_to'] full=$is_full_date}
{displayPrice price=($booking['total_price_tax_incl'] + $booking['extra_service_total_price_tax_incl']) currency=$orderCurrency['id']}
diff --git a/themes/hotel-reservation-theme/_partials/order-room-detail.tpl b/themes/hotel-reservation-theme/_partials/order-room-detail.tpl
index c51b8b1c5..6198e7b49 100644
--- a/themes/hotel-reservation-theme/_partials/order-room-detail.tpl
+++ b/themes/hotel-reservation-theme/_partials/order-room-detail.tpl
@@ -61,16 +61,17 @@
+ {assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
{l s='Check-in'}
- {$rm_v.data_form|date_format:'D'}, {dateFormat date=$rm_v.data_form}
+ {dateFormat date=$rm_v.data_form full=$is_full_date}
{l s='Check-out'}
- {$rm_v.data_to|date_format:'D'}, {dateFormat date=$rm_v.data_to}
+ {dateFormat date=$rm_v.data_to full=$is_full_date}
diff --git a/themes/hotel-reservation-theme/global.tpl b/themes/hotel-reservation-theme/global.tpl
index a1bc8715e..55a1cdd44 100644
--- a/themes/hotel-reservation-theme/global.tpl
+++ b/themes/hotel-reservation-theme/global.tpl
@@ -57,6 +57,7 @@
{addJsDef quickView=$quick_view|boolval}
{addJsDef displayList=Configuration::get('PS_GRID_PRODUCT')|boolval}
{addJsDef highDPI=Configuration::get('PS_HIGHT_DPI')|boolval}
+{addJsDef showFullDate=$show_full_date|boolval}
{* occupancy text *}
{addJsDef is_occupancy_wise_search=$is_occupancy_wise_search|boolval}
{addJsDef occupancy_required_for_booking=$occupancy_required_for_booking|boolval}
diff --git a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
index c0cf2c9df..d0698fa3e 100644
--- a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
+++ b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
@@ -124,7 +124,8 @@ $(document).ready(function() {
//JS Object : update the cart by ajax actions
var ajaxCart = {
- dateFormat: 'dd-mm-yy',
+ dateFormat: 'DD-MM-YYYY',
+ dateFormatFull: 'DD-MM-YYYY HH:mm:ss',
nb_total_products: 0,
//override every button in the page in relation to the cart
overrideButtonsInThePage: function() {
@@ -930,8 +931,11 @@ var ajaxCart = {
if (this.bookingData.date_diff !== 'undefined') {
$.each(this.bookingData.date_diff, function(date_diff_k, date_diff_v) {
+ from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form));
+ to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to));
+ let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
content += '';
- content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + ' ';
+ content += '' + moment(new Date(date_diff_v.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v.data_to)).format(dateFormatToUse) + ' ';
content += '' + date_diff_v.num_rm + ' ';
content += '' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + ' ';
content += '';
@@ -967,8 +971,11 @@ var ajaxCart = {
var product_price_float = this.price_float;
if (this.bookingData.date_diff !== 'undefined') {
$.each(this.bookingData.date_diff, function(date_diff_k1, date_diff_v1) {
+ from = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form));
+ to = $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to));
+ let dateFormatToUse = from == to ? ajaxCart.dateFormatFull : ajaxCart.dateFormat;
booking_dates_content += ' ';
- booking_dates_content += '' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + ' - ' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + ' ';
+ booking_dates_content += '' + moment(new Date(date_diff_v1.data_form)).format(dateFormatToUse) + ' - ' + moment(new Date(date_diff_v1.data_to)).format(dateFormatToUse) + ' ';
booking_dates_content += '' + date_diff_v1.num_rm + ' ';
booking_dates_content += '' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + ' ';
booking_dates_content += '';
@@ -1282,10 +1289,10 @@ function disableRoomTypeDemands(show) {
function disableRoomTypeServices(disable) {
if (disable) {
- $('#service_products_cont').find('button.select_room_service').attr('disabled', 'disabled');
+ $('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
- $('#service_products_cont').find('button.select_room_service').removeAttr('disabled');
+ $('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}
diff --git a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
index bfce85de7..4025fbcf7 100644
--- a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
+++ b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
@@ -133,8 +133,9 @@
{foreach from=$product.bookingData['date_diff'] key=data_k1 item=data_v}
+ {assign var="is_full_date" value=($show_full_date && ($data_v['data_form']|date_format:'%D' == $data_v['data_to']|date_format:'%D'))}
- {$data_v['data_form']|date_format:"%d-%m-%Y"} - {$data_v['data_to']|date_format:"%d-%m-%Y"}
+ {dateFormat date=$data_v['data_form'] full=$is_full_date} - {dateFormat date=$data_v['data_to'] full=$is_full_date}
{$data_v['num_rm']}
{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}
diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl
index d1408fb15..b9da73d60 100644
--- a/themes/hotel-reservation-theme/order-confirmation.tpl
+++ b/themes/hotel-reservation-theme/order-confirmation.tpl
@@ -120,17 +120,18 @@
{/block}
+ {assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
{block name='order_detail_room_type_check_in'}
- {$rm_v['data_form']|date_format:"%d-%m-%Y"}
+ {dateFormat date=$rm_v['data_form'] full=$is_full_date}
{/block}
{block name='order_detail_room_type_check_out'}
- {$rm_v['data_to']|date_format:"%d-%m-%Y"}
+ {dateFormat date=$rm_v['data_to'] full=$is_full_date}
{/block}
diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl
index 281019490..563f44879 100644
--- a/themes/hotel-reservation-theme/order-detail.tpl
+++ b/themes/hotel-reservation-theme/order-detail.tpl
@@ -846,10 +846,11 @@
{assign var='flag_is_first_iteration' value=true}
{foreach from=$cart_htl_data key=data_k item=data_v}
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
+ {assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
{$data_v.name}
- {dateFormat date=$rm_v.data_form} - {dateFormat date=$rm_v.data_to}
+ {dateFormat date=$rm_v.data_form full=$is_full_date} - {dateFormat date=$rm_v.data_to full=$is_full_date}
{if $flag_is_first_iteration}{assign var='flag_is_first_iteration' value=false}{/if}
diff --git a/themes/hotel-reservation-theme/order-return.tpl b/themes/hotel-reservation-theme/order-return.tpl
index b90ed3414..438aed994 100644
--- a/themes/hotel-reservation-theme/order-return.tpl
+++ b/themes/hotel-reservation-theme/order-return.tpl
@@ -71,7 +71,8 @@
{l s='Room'} - {$smarty.foreach.refundRequest.iteration|string_format:'%02d'}
{$booking['room_type_name']|escape:'htmlall':'UTF-8'}
{$booking['hotel_name']|escape:'htmlall':'UTF-8'}
- {$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To'} {$booking['date_to']|date_format:"%d-%m-%Y"}
+ {assign var="is_full_date" value=($show_full_date && ($booking['date_from']|date_format:'%D' == $booking['date_to']|date_format:'%D'))}
+ {dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To'} {dateFormat date=$booking['date_to'] full=$is_full_date}
{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}
{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}
{if $isRefundCompleted}
diff --git a/themes/hotel-reservation-theme/shopping-cart.tpl b/themes/hotel-reservation-theme/shopping-cart.tpl
index ac26d7ef5..c73a32ddf 100644
--- a/themes/hotel-reservation-theme/shopping-cart.tpl
+++ b/themes/hotel-reservation-theme/shopping-cart.tpl
@@ -153,14 +153,15 @@
{/if}
{/block}
{block name='shopping_cart_room_type_booking_information'}
+ {assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
{l s='CHECK IN'}
-
{$rm_v['data_form']|date_format:"%d %b, %a"}
+
{$rm_v['data_form']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_form']|date_format:"%H:%M"}{/if}
{l s='CHECK OUT'}
-
{$rm_v['data_to']|date_format:"%d %b, %a"}
+
{$rm_v['data_to']|date_format:"%d %b, %a"}{if $is_full_date} {$rm_v['data_to']|date_format:"%H:%M"}{/if}