• Resolved Hauzz

    (@hauzz)


    Hi, I found some very useful code to restict times in the time picker here
    My question is can I use two different restrictions? I’m using forminator as a booking system and normally the times available are between 16:00 and 22:00. But on Christmas the times are between 13:00 and 22:00. I’ve made a seperate page for booking on Christmas and would like to ristrict the times accordingly.
    Can that be done, I did not succeed after numerous attempts.
    Thanks.

    • This topic was modified 4 years, 11 months ago by Hauzz.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello there @hauzz

    Let me contact our developers about it and will get back to you as soon as possible. Your patience is highly appreciated! ??

    Thank you,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @hauzz

    It seems that this is possible and it’s forwarded to our Second Level Support team. We’ll keep you posted here as soon as there’s any development on this.

    Thank you,
    Dimitris

    Thread Starter Hauzz

    (@hauzz)

    Thank you very much Dimitris. I’m still trying to get it to work but till now no success.
    I guess I need to wait for your answer….

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hey there @hauzz

    Here’s a little custom plugin that should help you with this:
    https://gist.github.com/wpmudev-sls/cf096fd0c22aa17aa6097c12dff21df9

    Please keep in mind that you’ll have to edit some values, specifically for the following variables:

    // Set the Datepicker field
    $date_field_name = 'date-1';
    
    // Set the Timepicker field
    $time_field_name = 'time-1';
    
    // These are the hours and minutes that will be removed/hidden (from timepicker) per date
    $date_exclusions

    Warm regards,
    Dimitris

    Thread Starter Hauzz

    (@hauzz)

    Thanks for your answer Dimitris. Unfortunately I can’t get the code to work and frankly, I don’t think this is what I need. Maybe I did not make myself clear, it should be like this:
    on the 14th of december, a guest arrives at the page with the form and wants to make a reservation for Christmas. When he/she selects the 25th of december as the date, then the available hours should be from 1pm till 10pm. But when he selects the 27th of december, the available hours should be from 4pm till 10pm.
    Is that what the code you pointed me at is supposed to do?
    If so, what an I doing wrong?

    // Set the Datepicker field
    $date_field_name = 'date-1';
    
    // Set the Timepicker field
    $time_field_name = 'time-1';

    What do I have to change here?
    And

    // These are the hours and minutes that will be removed/hidden (from timepicker) per date
    $date_exclusions

    I think I need to adjust the dates in the array to my needs?

    Thanks for your time,
    Hans

    Thread Starter Hauzz

    (@hauzz)

    Dimitris,
    I think I finally see what’s happening with the first part of the code. Could it be possible to, instead of restrict hours, expanding them?
    In my post above you can see what I’m trying to achieve.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Different restricted times in time picker’ is closed to new replies.