Domanda

Ok, so I'm trying to edit the datepicker in my Gravity Form. It's a simple order for for flowers but I'm wanting to make it so you can't pick past dates, Sundays (we're closed) and if it's after 11am CST then it would block that day and go to the next.

Currently I've found a way to block past dates but anything and everything I've tried to disable Sundays has not worked, and I have no idea how to disable the day after 11am.

If anyone could lend a hand, that would be great! Thanks!!

What I have so far for the blocking of the past dates:

jQuery(document).ready(function($) {
    $("#input_1_5").datepicker({ minDate: 0 });
});
È stato utile?

Soluzione

   $(function () {
     $("#input_1_5").datepicker({
        minDate: new Date().getHours() >= 11 ? 1 : 0,
        beforeShowDay: function (date) {
        var day = date.getDay();
        return [(day !=0 ), ''];
        }
     });
   });
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top