0

"today's date and the next two days date" I did mean each time that someone want to pick a date the first three days (today, tomorrow and after-tomorrow) always are not possible to be selected....

 if (!Modernizr.inputtypes.date) {
        var $dates = $("input[type=date]");
        $dates.each(function () {
            var thisDate = $(this);
            thisDate.datepicker({
                minDate: thisDate.attr("min"),
                maxDate: thisDate.attr("max"),
                dateFormat: "mm-dd-yy"
            });
        });

var array = ["2013-03-14", "2013-03-15", "2013-03-16"] disable only specific dates.... Please guys.... can't find help for this on previous***strong text*** post.... got to be possible....

Rikesh
  • 26,156
  • 14
  • 79
  • 87
cat4500
  • 1
  • 3
  • [This](http://stackoverflow.com/questions/2333642/using-beforeshowday-in-jquery-ui-datepicker-to-close-out-days-of-the-week) and [That](http://stackoverflow.com/questions/14484159/jquery-datepicker-and-beforeshowday) should help you out. – Derek Apr 21 '14 at 21:59
  • Use BeforeShowDay -- http://stackoverflow.com/a/15400806/1634513 – fbonetti Apr 21 '14 at 22:01
  • http://api.jqueryui.com/datepicker/#option-beforeShowDay – fbonetti Apr 21 '14 at 22:02

2 Answers2

0
   if (!Modernizr.inputtypes.date) {
     var $dates = $("input[type=date]");
    $dates.each(function () {
        var thisDate = $(this);
        thisDate.datepicker({
            minDate: 3,
            maxDate: thisDate.attr("max"),
            dateFormat: "mm-dd-yy"
        });
      });
cat4500
  • 1
  • 3
  • I got most but not all of it.... total three days is done by "minDate 3".. but I lost the highlight of present date and still can enter the today date by hand on the input field – cat4500 Apr 22 '14 at 13:17
0
<script type="text/javascript">
    $("document").ready(function () {
        if (!Modernizr.input.placeholder) {
            makePlaceholders();
        }

        if (!Modernizr.inputtypes.date) {
            var $dates = $("input[type=date]");
            $dates.each(function () {
                var thisDate = $(this);
                thisDate.datepicker({
                    minDate: 3,
                    maxDate: thisDate.attr("max"),
                    dateFormat: "mm-dd-yy"


                });
            });
        }

         });


</script>
<script>
  $(document).ready(function() {
    $('#appointDate').datepicker({                  
        beforeShowDay: noSunday
      });

      function noSunday(date){
          var day = date.getDay();
                      return [(day > 0), ''];
      }; 

  });
  </script>
cat4500
  • 1
  • 3
  • Need help on this code. I achieved the Sundays blocked and the three blocked days, but they do not work in the same time. Which one is first in order take over. So if 'sunday off' first, then that is the only event that is going to happen, and if three days off are first in order, sunday off does not happen. Please some help here.... – cat4500 Apr 23 '14 at 15:07