Sunday, March 20, 2011

Modifying the jQuery UI Calendar Date Selection

While working on an application I had a need to modify the way dates where selected from the jQuery UI calendar control.  I needed to only allow the end user the capability of selecting a Monday.  After some searching of the internet I found the following solution.

/* date picker week */
$(".dateweek").datepicker({
    showOn: 'both',
    buttonImage: '/Content/Images/ui/calendar.png',
    buttonImageOnly: true,
    firstDay: 1,
    beforeShowDay: function (date) { return [date.getDay() == 1, ""] }
});

I can’t remember where exactly I got it although I did make some modifications to it.  The code I actually used is above.

1 comment:

  1. The Best Slots | Casino Roll
    The best slots at casino-roll.com Casino Roll. If you love table games, to play blackjack, you 토토 have to bet twice for febcasino the https://febcasino.com/review/merit-casino/ dealer to win. The https://septcasino.com/review/merit-casino/ dealer must

    ReplyDelete