Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full calendar business hours

Tags:

fullcalendar

I am trying to use business hour option, but I can't able to reflect the changes.

I want to display multiple business hours. Here is the code:

$('#calendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    defaultDate: '2014-11-12',
    editable: true,
    eventLimit: true, // allow "more" link when too many events
    businessHours:
        [
            {
                start: '10:00', // a start time (10am in this example)
                end: '12:00', // an end time (12pm in this example)
                dow: [1, 2, 3, 4]
                // days of week. an array of zero-based day of week integers (0=Sunday)
                // (Monday-Thursday in this example)
            },
            {
                start: '12:00', // a start time (12pm in this example)
                end: '18:00', // an end time (6pm in this example)
                dow: [1, 2, 3, 4]
                // days of week. an array of zero-based day of week integers (0=Sunday)
                // (Monday-Thursday in this example)
            }]
});  
like image 937
Sajjad Ali Khan Avatar asked Dec 29 '14 11:12

Sajjad Ali Khan


People also ask

What are the default business hours?

By default, Monday-Friday, 9am-5pm. If true, the default business hours will be emphasized ( view live demo ). If false (the default), there will be no emphasis. An object may be given to render business hours with fine-grain control over the days/hours. The object may have any of the following properties:

What is emphasized business hours?

Emphasizes certain time slots on the calendar. By default, Monday-Friday, 9am-5pm. If true, the default business hours will be emphasized ( view live demo ).

How are the working days and hours shown on the calendar?

For every month and quarter, the number of business (working) days and the working time (in hours) is shown on the right. The calendar is color-coded, i.e. each date is marked with a color that corresponds to the respective number of working hours, as shown below the table.

How to find the number of working (business) days in 2021?

With our interactive working time calendar you can easily find the number of working (business) days in 2021 along with the respective number of working hours. For every month and quarter, the number of business (working) days and the working time (in hours) is shown on the right.


2 Answers

like so

businessHours:
    {

            start: '11:00',
            end:   '12:00',
            dow: [ 1, 2, 3, 4, 5]
    },

in order to use different hours for different shifts -> use background events

events:
[
    {
        id:    'available_hours',
        start: '2015-1-13T8:00:00',
        end:   '2015-1-13T19:00:00',
        rendering: 'background'
    },
    {
        id:    'work',
        start: '2015-1-13T10:00:00',
        end:   '2015-1-13T16:00:00',
        constraint: 'available_hours'
    }
]

For more information, see this link, http://fullcalendar.io/docs/event_ui/eventConstraint/

There's several different ways you can approach this, depending on how you use the calendar. Hopefully the flexibility of the constraints will help you get what you need done.

Pretty glad this feature finally showed up!

like image 67
DoverAudio Avatar answered Oct 26 '22 22:10

DoverAudio


I have to show FullCaledar Time Slot for 8AM to 8PM fixed, so I have did some R&D, and apply following options, and it seems working fine!!! Cheers.

jq('#calendar').fullCalendar({
        header: {
          left: 'prev,next',
          center: 'title',
          right: 'today,month,agendaWeek,resourceDay'
        },
        defaultView: 'resourceDay',
        allDaySlot: false,
        axisFormat: 'h:mm A',
        timeFormat: 'h:mm T',
        minTime: '08:00:00',
        maxTime: '20:00:00',

Use, minTime: '08:00:00', maxTime: '20:00:00'

Thanks!!!

like image 33
Affan Pathan Avatar answered Oct 26 '22 23:10

Affan Pathan