0

We're using jQuery UI datepicker and need to limit the selection so the user can't select days past 28 for any month... not seeing this as an option or quite how to inject this, but I'd be fine also just writing my own Javascript after the fact to change the day if they select one we don't want.

Tried function beforeShowDay

jQuery("input[nodeName='date']").datepicker('option', {beforeShowDay: function(date) {
    var d = date.getDate();
    if(d == 29 || d == 30 || d == 31) {
        return [false];
    } else return [true];
}});

and it works however it also closes the calendar as soon as it opens for some reason.

We're using jQuery UI 1.10 datepicker and there's no feasible way we can upgrade with our decrepit app.

Dave Heq
  • 356
  • 4
  • 18

0 Answers0