See my preview: https://bbhs1k0zaid6uup2-52440563892.shopifypreview.com
I want to modify datepicker to block weekends AND dates from an array. So far I have the code below which displays datepicker but without disabling the 3 dates in offDays array:
{{ ‘//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js’ | script_tag }}
Choose a date for delivery or pickup:
blah
I’ve found a call to beforeShowDay with a function. That would be nice if I could make it work!
beforeShowDay: function(date){
md = date.getDate() + “-” + (date.getMonth()+1);
if (offDays.indexOf(md) != -1){
return false;
}
else {
return true;
}
}
This snippet which I called d-offdays works. Embed it in a section with {% render ‘d-offdays’ %}
It - disables dates in array AND days starting with S. Modify at will.
{{ ‘//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css’ | stylesheet_tag }}
Hi, so what would this look like if you did want weekends on?
Replace
if (($.inArray(md, offDays) != -1) || (date.toDateString().substr(0,1)==“S” ))
with
if($.inArray(md, offDays) != -1){
will not exclude days starting with S. It will only exclude days in the array.
How can I set this to have Sundays disabled?