• Resolved MKay

    (@mongia)


    Hello I’m trying to add a custom time interval using the filter provided, so I wrote the following code in my theme functions.php file

    if ( !function_exists( 'rtb_setting_time_interval_options' ) ) {
    function zem_custom_time_interval ( $intervals ) {
    $intervals['75'] = __( 'Every 75 minutes', 'restaurant-reservations' );

    return $intervals;
    }
    add_filter( 'rtb_setting_time_interval_options', 'zem_custom_time_interval' );
    }

    I also selected a custom schedule time from 6pm to 11pm, as for project needs.

    It works as expected in admin. I can select the corresponding item from the dropdown list, it’s saved as option and so on, but when I act as a client and try to select a time slot, the first available slot is at 6.45pm.

    I made several attempts and it seems it calculates time slots starting always from 12am.

    Could you help me, please?

    Edit: I forgot mentioning that the linked page I wrote is a development website with restricted access.

    • This topic was modified 1 year, 1 month ago by MKay.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hi MKay,

    The plugin calculates time slots starting from 12:00 AM. As such, when you set a 75-minute interval, it generates times in the pattern following 12:00 AM, 1:15 AM, 2:30 AM, 3:45 AM, and so on, continuing through the day. It only shows the ones that continue that pattern and fall within your 6 PM–11 PM schedule, which is why 6:45 PM ends up being the first available slot. To fix this, you can set the interval to something smaller like 15 minutes and use custom CSS to hide the unwanted time slots, as the plugin doesn’t currently support changing the starting point of the interval.

    Thread Starter MKay

    (@mongia)

    Hi, your explanation confirms what I figured out.

    I guess it’d be nice that time slots would be calculated starting from the start hour in the case it has been set up, but the CSS hiding workaround could be suitable to what I’m trying to achieve.

    Thank for your support and have a nice day.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom time interval, wrong time slots’ is closed to new replies.