How block / disable a day in picker date

Hi guys thanks for your help, I tried lot of weeks with that but is difficult for me… (Please dont recommend the air plugin or other because I need this native one)

Im trying to do it by myself but it isn’t work…

I have a native picker for reservations and I need to block Sunday because the restaurant is off that day.

So in the forum I saw couple of ideas but I dont know how to execute them.

This is the information That I Have.

My app with the picker:

Other guys said on the forum that just I need to put an HTML element in the same page that the picker time and then add the follow code:

var $input=$(‘input.date_div.picker__input’).pickadate();
var picker=$input.pickadate(‘picker’);
picker.set(“disable”, [1,4,7]);

I put the ID to the picker and to the HTML element. but nothing.

I hear to add the toolbox plugin, I did it but nothing.
Maybe I am failing in the execution, some ID, some code or setting…

I tryied a lot of ideas but still not working. If you guys have a moment and have an idea to give me I will happy really. Thank you very much

The solution mentioned in the forum post actually works: Date/Time picker block days [Solved], but there were some parts omitted.

There were quote/double quote problems in the code, probably lost in copy paste. Also, you have to wait for loading the page, that’s why the code should run when the page is fully loaded. Simply, add this code to the HTML element:

<script>
$(function() {
   var $input=$('input.date_div.picker__input').pickadate();
   var picker=$input.pickadate('picker');
   picker.set("disable", [7]);
});
</script>

See the demo:
chrome_iGkrmdallh

And here is the editor if you want to see yourself: Tests for Forum 11 | Bubble Editor

1 Like

Thank you my friend! Now it’s working properly

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.