# Form booking\_make timeslot values

**URL:** <https://community.hivepress.io/t/form-booking-make-timeslot-values/5927>\
**Category:** Bookings\
**Tags:** bookings\
**Created:** [May 21, 2023, 12:55pm UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927 "2023-05-21T12:55:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munchies4U](https://community.hivepress.io/user_avatar/community.hivepress.io/munchies4u/32/5975_2.png) [@Munchies4U](https://community.hivepress.io/u/Munchies4U)\
**Post date:** [May 21, 2023, 12:55pm UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927/1 "2023-05-21T12:55:55Z")

</div>

Hi there team HP

I refer topic [Booking form fields - unset](https://community.hivepress.io/t/booking-form-fields-unset/5354/1)

Is there a way to pass default values to the booking\_make form for the start and end times as the code referred to above works but on the booking\_confirm form when clicking to proceed to payment the form presents an error of _The start date can’t be later than the end date._?

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [May 22, 2023, 12:50pm UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927/3 "2023-05-22T12:50:59Z")

</div>

So you want to set default values for the start and end dates in the booking\_make form on the single listing page. Am I correctly understanding you?

---

<div class="post-metadata">

**Author:** ![Munchies4U](https://community.hivepress.io/user_avatar/community.hivepress.io/munchies4u/32/5975_2.png) [@Munchies4U](https://community.hivepress.io/u/Munchies4U)\
**Post date:** [May 23, 2023, 11:16am UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927/4 "2023-05-23T11:16:53Z")

</div>

Hi there Yevhen  
I’d like to pass a default value of 00:00 to the booking\_min\_time attribute (and hide it with CSS that I can do myself) and let the vendor set the booking\_max\_time on the listing\_submit or listing\_update forms.

---

<div class="post-metadata">

**Author:** ![yevhen](https://community.hivepress.io/user_avatar/community.hivepress.io/yevhen/32/23_2.png) [@yevhen](https://community.hivepress.io/u/yevhen)\
**Post date:** [May 26, 2023, 10:53am UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927/6 "2023-05-26T10:53:09Z")

</div>

Thank you for waiting. Please try this PHP code snippet

```auto
add_action(
	'hivepress/v1/models/listing/create', 
	function($listing_id) {
		if(hivepress()->get_version( 'bookings' )){
			update_post_meta($listing_id, 'hp_booking_min_time', 0);	
		}
	},
	1000
);

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset($attributes['booking_min_time']) ) {
			$attributes['booking_min_time']['editable'] = false;
		}

		return $attributes;
	},
	1000
);

```

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [June 25, 2023, 10:53am UTC](https://community.hivepress.io/t/form-booking-make-timeslot-values/5927/7 "2023-06-25T10:53:23Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
