开发者

Calendar plugin for displaying opening hours for specific days?

开发者 https://www.devze.com 2023-02-23 07:00 出处:网络
I need a calendar plugin (preferably for jQuery or even better WordPress) that shows the opening hours when clicking on a date.

I need a calendar plugin (preferably for jQuery or even better WordPress) that shows the opening hours when clicking on a date.

The opening hours vary depen开发者_如何学编程ding on the day of the week and also on the season.

I already took a look at various calendar plugins but most of them are date pickers or oriented to publish events.


FullCalendar will do what you want.

You will need to set a handler on the dayClick event (documentation).

For example:

$("#calDiv").fullCalendar(
dayClick: function(date, allDay, jsEvent, view) {
    // change the day's background color just for fun
    $(this).css('background-color', '#6495ED');

    // assuming a call that goes to the server and gets HTML for an opening hours popup
    $.ajax(
         url: '/path/to/get/hours',
         data: {'date' : date}, // pass the date as a param,
         dataType: 'html',
         success: function(data) {
             $("#divForPopup").html(data).show();
         }
    );
}
);

Alternatively you could create an event for each day that shows opening hours (or total hours opened, including closing hours).

0

精彩评论

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