Bienvenido, Invitado
Recordarme

TEMA:

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242283

  • Autor del tema
  • ulfak
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 61
  • Gracias recibidas: 0
Hey!

I work with a customer who has a catering company. We have created a form where you can order catering from the website. The form has a calendar-field where you can choose which day and time you want the catering.

Now my customer is wondering if it is possible to make a specific day non-selectable. The reason for this is that sometimes he gets full booked and cannot receive more orders that day.

Is there any solution for this?

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242286

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10135
  • Karma: 3
  • Gracias recibidas: 682
Hi,

Go to your form Advanced->more options->Form pieces->Before form->Custom, and put this code for example:
echo '<script type="text/javascript">
                                        
    JQuery(document).ready(function () {
                             
        JQuery("#ff_elem1293_calendarButton").pickadate({
			format: "yyyy-dd-mm", 
                        selectMonths: true,
                        selectYears:100,
                        min: [2020,1,1], max:[2110,1,1],
                        disable:[[2020,5,7]],
			onSet: function() {JQuery("#ff_elem1293").val(this.get("value"));}
		});
        });
</script>'

Note: Please make sure to replace both instances of ff_elem1293 with the correct ID of responsive calendar element in your form.

Note 2: Here I disabled 7.6.2020. I put this 2020,5,7, because months are counted from 0 - 11. So for 7.6.2020. it will be [2020,5,7] not [2020,6,7].

Let me know if it is ok for you.

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by tihana.krivic.

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242291

  • Avatar de TheMuffinMan
  • TheMuffinMan
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 10062
  • Karma: 167
  • Gracias recibidas: 809
@ULFAK

you can determine the calendar id (the number) that Tihana is talking about if you right click on the element with the browser and hit "inspect".

Regards,
Markus

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242587

  • Autor del tema
  • ulfak
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 61
  • Gracias recibidas: 0
Hi again and thanks for the suggestions

I have tried but did not manage to solve it. I have put the following code at custom but nothing happens. The date 17 of june is still selectable.
echo '<script type="text/javascript">
                                        
    JQuery(document).ready(function () {
                             
        JQuery("#ff_elem220").pickadate({
			format: "yyyy-dd-mm", 
                        selectMonths: true,
                        selectYears:100,
                        min: [2020,1,1], max:[2110,1,1],
                        disable:[[2020,5,17]],
			onSet: function() {JQuery("#ff_elem220").val(this.get("value"));}
		});
        });

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242588

  • Autor del tema
  • ulfak
  • Fuera de línea
  • Junior Breezer
  • Junior Breezer
  • Mensajes: 61
  • Gracias recibidas: 0
Im using the element type "Calender" not "Responsive calender" if it is any help

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

How to exclude a day from calender / make it non-selectable 1 año 11 meses antes #242594

  • Avatar de tihana.krivic
  • tihana.krivic
  • Fuera de línea
  • Moderator
  • Moderator
  • Mensajes: 10135
  • Karma: 3
  • Gracias recibidas: 682
Hi,

this code works for "responsive calendar".
I will test it for the "calendar" so I will give you feedback.

Regards,
Tihana

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Moderadores: ForumSupport
Tiempo de carga de la página: 0.058 segundos