Sauter la navigation

[Résolu] Toolset Form – Date Field

This support ticket is created Il y a 9 mois. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Minesh Il y a 9 mois.

Assisté par: Minesh.

Auteur
Publications
#2711427

Hey,

I want to disable Monday, Saturday and Sunday from the calendar on the date field. Can you please advise

#2711437

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you try to add the following code to custom JS section of your content template or forms:

jQuery(document).ready(function(){

jQuery("input[name='your-field-name']").datepicker({
  //beforeShowDay: $.datepicker.noWeekends
   beforeShowDay: function(date) {
        var day = date.getDay();
        return [(day !=0 && day != 5 && day != 6), ''];
    }
});

});

Where:
- Replace "your-field-name" with your original datepicker field name.

If that does not help, please share problem URL and admin access details and for what field you want to disable the days.