I want to show only business hours in a daily agenda view from 8:30 to 17:00, like below:
Just go from the startDate to the endDate and check if any of those days are weekends. If so, display the alert / popup and return false. select: (start, end, allDay) => { var startDate = moment(start), endDate = moment(end), date = startDate. clone(), isWeekend = false; while (date.
Here is an example of how to specify an array of events: var calendar = new Calendar(calendarEl, { events: [ { title : 'event1', start : '2010-01-01' }, { title : 'event2', start : '2010-01-05', end : '2010-01-07' }, { title : 'event3', start : '2010-01-09T12:30:00', allDay : false // will make the time show } ] });
You can add any image url to your eventObject by adding the attribute "imageurl" inside of the events definition (if you just want the image, don't specify a title):
The calendar's dates can change any time the user does the following: click the prev/next buttons, change the view, click a navlink. The dates can also change when the current-date is manipulated via the API, such as when gotoDate is called. datesSet is called after the new date range has been rendered.
Are you asking how to hide hours outside of business hours? If so, use the minTime and maxTime options:
http://fullcalendar.io/docs/agenda/minTime/
http://fullcalendar.io/docs/agenda/maxTime/
for instance, for a 9am - 5pm calendar:
$(document).ready(function() {
$('#calendar').fullCalendar({
...
minTime: "09:00:00",
maxTime: "17:00:00",
...
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With