Commit b4e0ccb0 authored by droces's avatar droces

Stats page > Fix for getting calendar days in month

parent 83a2b91c
......@@ -193,7 +193,8 @@ function stats_get_occupancy_perc($date_ranges, $bookable_nid = NULL) {
::createFromFormat('Y-m-d', $dates_pair[1]);
$start_month = intval($i_date->format('n'));
$start_year = intval($i_date->format('Y'));
$days_in_month = cal_days_in_month(CAL_GREGORIAN, $start_month , $start_year);
// $days_in_month = \cal_days_in_month(CAL_GREGORIAN, $start_month , $start_year);
$days_in_month = date('t', mktime(0, 0, 0, $start_month, 1, $start_year));
// kint($days_in_month, '$days_in_month');
$days_occupied = 0;
......@@ -255,4 +256,4 @@ function stats_get_revenue($date_ranges, $bookable_nid = NULL) {
$data[$key] = intval($total);
}
return $data;
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment