Skip to content

Commit

Permalink
Merge pull request #599 from abhishek-webkul/gli-1241
Browse files Browse the repository at this point in the history
Fix js errors on admin book now page
  • Loading branch information
rohit053 authored Mar 7, 2023
2 parents 23ca24b + 8e7566d commit 13254e1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 0 additions & 1 deletion js/fullcalendar/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9501,7 +9501,6 @@ var FullCalendar = (function (exports) {
});
return (createElement(ContentHook, { hookProps: hookProps, content: options.dayCellContent, defaultContent: props.defaultContent }, props.children));
};
console.log(DayCellContent);
return DayCellContent;
}(BaseComponent));
function refineDayCellHookProps(raw) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,19 @@ public function ajaxProcessGetCalenderData()
$bookingParams['date_from'] = $cal_date_from;
$bookingParams['date_to'] = $cal_date_to;
$eventData = $objBookingDetail->getBookingData($bookingParams);
if (!$eventData) {
$eventData['stats'] = array(
'total_room_type' => 0,
'total_rooms' => 0,
'max_avail_occupancy' => 0,
'num_unavail' => 0,
'num_cart' => 0,
'num_booked' => 0,
'num_avail' => 0,
'num_part_avai' => 0,
);
}

$eventData['date_format'] = Tools::displayDate($cal_date_from);
$events[strtotime($bookingParams['date_from'])] = array(
'is_notification' => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $(document).ready(function() {
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#7EC77B');
} else if (info.event.extendedProps.data.stats.num_part_avai > 0) {
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#FFC224');
} else if (info.event.extendedProps.data.stats.num_booked == info.event.extendedProps.data.stats.total_rooms) {
} else if ((info.event.extendedProps.data.stats.num_booked == info.event.extendedProps.data.stats.total_rooms) && info.event.extendedProps.data.stats.total_rooms != 0) {
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#00AFF0');
} else {
$(info.el).closest('td').find('.day-info svg circle').attr('fill', '#FF3838');
Expand Down

0 comments on commit 13254e1

Please sign in to comment.