|
20 | 20 | */ |
21 | 21 | class GPB_Daily_Service_Limit { |
22 | 22 |
|
23 | | - private $form_id; |
24 | | - private $service_ids; |
25 | | - private $daily_limit; |
26 | | - private $capacity_message; |
27 | | - |
28 | | - public function __construct( array $args ) { |
29 | | - $args = wp_parse_args( $args, array( |
30 | | - 'form_id' => false, |
31 | | - 'service_ids' => array(), |
32 | | - 'daily_limit' => 10, |
33 | | - 'capacity_message' => __( 'We are fully booked for that day. Please choose another date.', 'gp-bookings' ), |
34 | | - ) ); |
| 23 | + private $form_id; |
| 24 | + private $service_ids; |
| 25 | + private $daily_limit; |
| 26 | + private $capacity_message; |
| 27 | + |
| 28 | + public function __construct( array $args ) { |
| 29 | + $args = wp_parse_args( $args, array( |
| 30 | + 'form_id' => false, |
| 31 | + 'service_ids' => array(), |
| 32 | + 'daily_limit' => 10, |
| 33 | + 'capacity_message' => __( 'We are fully booked for that day. Please choose another date.', 'gp-bookings' ), |
| 34 | + )); |
35 | 35 |
|
36 | 36 | $this->form_id = $args['form_id']; |
37 | 37 | $this->service_ids = array_map( 'intval', (array) $args['service_ids'] ); |
@@ -147,8 +147,8 @@ public function validate_submission( $result ) { |
147 | 147 | } |
148 | 148 |
|
149 | 149 | private function get_total_for_date( string $date ): int { |
150 | | - $start = $date . ' 00:00:00'; |
151 | | - $end = $date . ' 23:59:59'; |
| 150 | + $start = $date . ' 00:00:00'; |
| 151 | + $end = $date . ' 23:59:59'; |
152 | 152 | // Count both pending and confirmed bookings to reflect in-progress reservations. |
153 | 153 | $bookings = \GP_Bookings\Queries\Booking_Query::get_bookings_in_range( |
154 | 154 | $start, |
|
0 commit comments