How can I disable specific days in a datepicker code?

Hi there,

I have seen similar posts to mine, but I cannot seem to get their answers to work for mine.

I am trying to use the Date Picker code from https://help.shopify.com/themes/customization/cart/add-date-picker-for-delivery-dates to add a calendar where people can select the days they want their products delivered, but I would like to remove Tuesday - Thursday from the options. My code currently looks like this:

{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
  

  

    

      
      
       We do not deliver during the week-end.
    

  

  

This removes weekends from the calendar fine, but whenever I try to change/add something to the code as per other suggestions to remove different days, the calendar just stops appearing all together in the website.

Does anyone know how to change this code so that only Tuesday - Thursday is not available for delivery.

Thanks in advance

Tom

Hi @TomKenny ,

You can try with this snippet on the “beforeShowDay” key:

beforeShowDay: function (date) {

if (date.getDay() == 2 || date.getDay() == 4) {

return [false, ‘’];

} else {

return [true, ‘’];

}

}

Link to refer: https://jsfiddle.net/EvanPham/L46mfez7/

Screenshot to refer: https://prnt.sc/11cc8un

Hope this helps.

Amazing, finally worked! Thank you so much!!

Hi @TomKenny ,

It’s our pleasure when helping you. If you find my comments are helpful, please hit Like and Accept as a Solution. It absolutely encourages us!

Feel free to let me know if you need further support from us!

Greetings,

LitExtension Team

My calendar is set based on 3 different locations (karachi, lahore, others )i want to make sundays off in other can anyone tell how to make it happen.

this is my code