Saltar navegación

[Resuelto] Disable weekends on Toolset Forms datepicker

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

The customer wrote that he is trying to disable the weekends, from the date picker in Toolset Forms, but it is not working.

Solution:

Shared slightly updated JS code example:


jQuery(window).bind("load", function() {
jQuery( ".js-wpt-date" ).datepicker( "option", "beforeShowDay", jQuery.datepicker.noWeekends , );
});

Relevant Documentation:

n/a

This support ticket is created hace 3 años, 7 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Karachi (GMT+05:00)

Etiquetado: 

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por umbertoZ hace 3 años, 7 meses.

Asistido por: Waqar.

Autor
Mensajes
#2222659

Hi, I'm trying to customize the Toolset Forms datepicker.

I want to disable weekends days.

I tried this:

jQuery(document).ready(function($) {

  // before 18 years ago
  setTimeout(function() {
    if($( "input.js-wpt-date" )) {          
      $("input.js-wpt-date").each(function() {

        val = $(this).val();
        $(this).datepicker({
          beforeShowDay: $.datepicker.noWeekends
        });
        $(this).val(val);
      });
    }
  }, 500 );

});

It doesn't work.

Can you help me?

thanks

#2222975

Hi,

Thank you for contacting us and I'd be happy to assist.

On my test website, I was able to make this work, using this code:


jQuery(window).bind("load", function() {
jQuery( ".js-wpt-date" ).datepicker( "option", "beforeShowDay", jQuery.datepicker.noWeekends , );
});

regards,
Waqar

#2223187

My issue is resolved now. Thank you!