Skip to content

Commit 81915ec

Browse files
authored
gpb-daily-service-booking-limit.php: Added a new snippet
1 parent 5ef5330 commit 81915ec

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

gp-bookings/gpb-daily-service-booking-limit.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
*/
2121
class GPB_Daily_Service_Limit {
2222

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+
));
3535

3636
$this->form_id = $args['form_id'];
3737
$this->service_ids = array_map( 'intval', (array) $args['service_ids'] );
@@ -147,8 +147,8 @@ public function validate_submission( $result ) {
147147
}
148148

149149
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';
152152
// Count both pending and confirmed bookings to reflect in-progress reservations.
153153
$bookings = \GP_Bookings\Queries\Booking_Query::get_bookings_in_range(
154154
$start,

0 commit comments

Comments
 (0)