0

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

i will get a set of dates from the database. i have to enable only those dates in jQuery calendar. How can i do it ?

Community
  • 1
  • 1
Rauf
  • 12,326
  • 20
  • 77
  • 126
  • 1
    hi, we would all like to help you out but you'll have to help yourself first by trying out some code, posting it here and maybe accept some answers to your previous questions while you're at it :) – corroded Mar 16 '11 at 04:30
  • would you care telling what calendar are you using? – S L Mar 16 '11 at 04:42

2 Answers2

1

Check out this datepicker http://davidwalsh.name/jquery-datepicker-disable-days

usmanali
  • 2,028
  • 2
  • 27
  • 38
0

You could use this jQuery plugin which makes use of jQuery-UI's date picker

http://balupton.com/sandbox/jquery-sparkle/demo/#eventcalendar

Just query your database and return a JSON object in this format

{
    "entries": [
        {
            "id": 1,
            "title": "My First Entry",
            "start": "2010-07-14 11:11:00",
            "finish": "2010-07-14 14:23:18",
            "user": {
                "name": "Joe"
            }
        },
        {
            "id": 2,
            "title": "My Second Entry",
            "start": "2010-07-14 11:11:00",
            "finish": "2010-07-15 14:23:18",
            "user": {
                "name": "Joe"
            }
        }
    ]
}

then just add it as an option to the plugin:

$eventCal.EventCalendar({
        // Ajax Variables
        /** The JSON variable that will be return on the AJAX request which will contain our entries */
        ajaxEntriesVariable: 'entries',
        /** The AJAX url to request for our entries */
        ajaxEntriesUrl: './eventcalendar.json'
});
Aivan Monceller
  • 4,636
  • 10
  • 42
  • 69