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 */
    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. Being underneath the Caesars Entertainment wing, the model provides a 1xbet robust platform that comes with all the essentials. The Malta Gaming Authority, more generally generally known as|often recognized as} the MGA, is a well-renowned iGaming regulator. The organization safeguards players' rights and goals to take care of up} high standards within the business. The MGA is a pillar of equity and transparency for players and operators alike. GLI present testing, certification and skilled companies to the global gaming business.