1

Possible Duplicate:
Can the jQuery UI Datepicker be made to disable Saturdays and Sundays (and holidays)?

So far I have it shows number of estimated delivery days but I want to exclude weekends and holidays from calculation. Any ideas?

<script>
    $(function () {
        $("#datepicker").datepicker({
            onSelect: function () {
                var start = $('#datepicker').val();
                var date = new Date(start);
                var d = date.getDate();
                var m = date.getMonth();
                var y = date.getFullYear();
                var myday = new Date(y, m, d + 10);
                $('#showdate').val($.datepicker.formatDate('mm/dd/yy', myday));
            }
        });
    });
</script>
Community
  • 1
  • 1
D S
  • 11
  • 1
  • Holidays for what country/region/religion? You'll likely have to do that part manually using an array of dates. – MrOBrian Jul 24 '12 at 18:38
  • Holidays and Weekends for USA only – D S Jul 24 '12 at 18:48
  • You'll need to loop through the days, use `.getDay()` to determine if it's a weekend day, and compare against an array of holidays to see if it's a holiday – MrOBrian Jul 24 '12 at 18:52

0 Answers0