Looking to restrict the time selection for weekends/individual days, but keep a standard time selection for all other days. I already implemented the filter_gf_awp_calendar_allow_time hook, but want some further customization so people can’t try and make a selection for when the business isn’t open/taking appointments. Any help is greatly appreciated. Thanks!
]]>This solution demonstrates how to limit the time slots in the Gravity Forms Date Time field add-on to 30-minute intervals with a 15-minute gap after each slot. By dynamically generating the time slots within the specified range, you can create a more user-friendly time selection interface.
add_filter('gf_awp_calendar_allow_time', 'filter_gf_awp_calendar_allow_time', 10, 2);
function filter_gf_awp_calendar_allow_time($allow_time, $form) {
$start_time = strtotime('09:00');
$end_time = strtotime('17:00');
$time_slots = array();
while ($start_time < $end_time) {
$time_slots[] = date('H:i', $start_time);
$start_time += (30 * 60); // Add 30 minutes
$start_time += (15 * 60); // Add 15 minutes gap
}
return $time_slots;
}
This code snippet will generate time slots from 9:00 AM to 5:00 PM with 30-minute intervals and a 15-minute gap after each slot, ensuring a more structured and convenient time selection experience for users.
Add this code in your child theme functions.php
Can the start day of the week be changed?
Thank you.
]]>Hello, thanks for offering this plugin for free!
Is there any chance of including support for Gravity Wiz’ Gravity Forms Date Time Calculator? See: https://gravitywiz.com/documentation/gravity-forms-date-time-calculator/
I have to make sure one of two date/time fields is in the future (+1 day).
Thank you.
]]>Today and future days are active. Last days blocked
https://drive.google.com/file/d/1ucAP6pey8ENTD94f4pjYUxtv7Uelqxlb/view?usp=drive_link
Users can now limit time using below hook
add_filter('gf_awp_calendar_allow_time', 'filter_gf_awp_calendar_allow_time', 10, 2);
function filter_gf_awp_calendar_allow_time($allow_time, $form) {
// Specify time in 24 hour format.
$allow_time = array(
'13:00',
'01:00',
'02:00',
'16:00',
'17:00',
'18:00',
'19:00',
'20:00',
);
return $allow_time;
}
]]>
hello, How can I translate in italian the month, day and hour?
Thank you so much
The calendar is not fully viewed on mobile so there no way that a customer can pick a date . Just time , because that is the only visible part of the calendar ?
I tried a lot of CSS that might work but unfortunately nothing solve the issue .
I want to the calendar in full screen view upon clicking the date and time field then close after the customer pick the respective date and time to go ahead and fill up the other fields
Any help ?
Thanks !
]]>The arrow is literally not visible .
]]>hello Awais,
wrote you 2 years ago and you mentioned to bring it into the code?
any changes?
]]>Hi! I’m using the gravity forms shortcode in PHP in custom ACF blocks without the do_shortcode function (as it loads the necessary js on frontend. When your plugin is enabled, i’m received a JSON error when trying to save a page. The error is not there, when the plugin is disabled. Do you have any suggestions, how to fix this?
]]>After activating the plugin, I tried to add a new field. However, the ‘Date-Time’ field was not in the list of Advanced Fields as I had expected.
]]>Hi,
Is it possible to remove some of the hrs and limit the option to 9AM-5PM?
Thanks!
]]>Great plugin!
I was wondering if we can set a recurring day of the week instead of the date?
Thanks
Thanks for creating this great plugin.
I noticed on my site the GF DateTime picker would render in the style of jQuery UI’s Datepicker.
I fixed my issue by adding the following filters to make sure Advanced Custom Field’s datetimepicker JS and CSS are not enqueued on the frontend (I’m not using their frontend forms):
if ( ! is_admin() ) {
add_filter( 'acf/settings/enqueue_datetimepicker', '__return_false' );
add_filter( 'acf/settings/enqueue_datepicker', '__return_false' );
}
Wanted to share this fix in case anyone else is having this issue.
I can’t work out what causes ACF’s datetimepicker CSS/JS to be enqueued in frontend pages however.
I installed a fresh WordPress site with the Twenty Twenty-One Theme, Gravity Forms, Date Time Field Add-On for Gravity Form and Advanced Custom Fields Pro. Latest versions of each. I wanted to provide you with an easy to reproduce environment for seeing this issue.
Your DateTime GF field renders fine however – because ACF is not enqueuing their datetimepicker CSS/JS on my test page.
Thank you,
Nathan
I have a date : time picker on a form which is in a pop up and it automatically closes the popup when the date and time is selected.
Is there a way to allow users to select the date time and not close the pop up until submit?
You can see this by clicking the “schedule now” button just under the main banner.
]]>HI,
great plugin.
in the selection I can only see the am/pm time periods. I tried to change the format to
HH:mm but still the same. How to change to european time frame?
thanks
stephan