开发者

enable/disable specific dates [duplicate]

This question already has answers here: Closed 11 years ago.

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 jQue开发者_运维知识库ry calendar. How can i do it ?


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


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'
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜