0

I would like to control the time with the date in my form.
Here is the link: https://form.designactive.net/powers-pediatrics/
I would like to set different time option for Mon-Thu and if people select Fri or Sat then the time should change to 9:00 am to 12:30 pm. If people select the other days between Mon-Thu then the time will need to be same as right now. Please help me about it so I can add it. I've added some code in the form JavaScript in order to disable the Sunday. Here is the code:

jQuery(function ($) {
    var datepicker = $('.quform-field-2_18').data('kendoDatePicker');

    if (datepicker) {
        datepicker.setOptions({
            disableDates: function (date) {
                return date && (date.getDay() === 0 || date.getDay() === 7);                
            }
        });
    }
});

2_18 is the filed id. Now what code should I add in order to control the time with the date like I described? I am using quform wordpress plugin. Thanks

I've added the code in here

Md waheed
  • 1
  • 1
  • Please take a look at a similar question: https://stackoverflow.com/questions/14500397/setting-datetimepicker-to-show-specific-time-range-e-g-working-hours-only – Lalith Katta Mar 16 '19 at 17:49
  • *getDay* returns a number in the range 0 to 6, so `date.getDay() === 7` will always be false. Monday to Thursday is 1 to 4, Friday to Saturday is 5 to 6. – RobG Mar 16 '19 at 21:52
  • So What should I do? what code should I use in the time field? Like if user select the Friday or Saturday in the calendar the time needs to be change to 9:00 am to 12:30 pm within that range. – Md waheed Mar 18 '19 at 08:57

0 Answers0