2

I need to disable dates e.g. weekends and holidays on a jQueryMobile date picker similar to the jQuery datePicker http://forum.jquery.com/topic/datepicker-beforeshowdate.

I'm using Mobiscroll http://code.google.com/p/mobiscroll/ where there are no date restrictions. Is it possible to restrict dates with mobiscroll?

My question is: what is the best approach to disabling dates for a smart phone datepicker (including mobiscroll and other options)?

Levi Kovacs
  • 1,159
  • 8
  • 14
Marx
  • 113
  • 12

2 Answers2

0

DateBox in calendar mode works (DateBox).

J.T.Sage
  • 1,984
  • 14
  • 21
Marx
  • 113
  • 12
0

Did you try to validate on the onSelect event? If it's not a valid selection, pop a message or something.

EDIT: Starting from mobiscroll 2.0 you can disable (make them un-selectable) date with the invalid option.

Check out the documentation for more info: http://docs.mobiscroll.com

EDIT: Disable recurring days like days of week, or recurring dates with daysOfMonth, or exact dates by passing a Date object.

$('#demo').mobiscroll().date({
    invalid: { daysOfWeek: [0, 6], daysOfMonth: ['5/1', '12/24', '12/25'] }
});
Levi Kovacs
  • 1,159
  • 8
  • 14