Home > Web Front-end > JS Tutorial > body text

How Can I Schedule Recurring Events With Day-Specific Availability in FullCalendar?

Mary-Kate Olsen
Release: 2024-11-11 09:42:03
Original
763 people have browsed it

How Can I Schedule Recurring Events With Day-Specific Availability in FullCalendar?

Handling Recurring Events in FullCalendar with Days-Specific Schedule

FullCalendar provides flexible options to handle recurring events, including scheduling events for specific days of the week. This allows for precise control over availability and appointment scheduling.

Simple Repeating Events

For simple recurring events that occur on specific days of the week, you can use the dow property in the event object. For example, to create an event that occurs every Monday and Thursday from 7:00 AM to 9:00 AM, you would use the following code:

events: [{
    title: "Morning Availability",
    start: '07:00',
    end: '09:00',
    dow: [ 1, 4 ]
}]
Copy after login

Restricting Recurrence with Date Ranges

To restrict the recurrence of events to specific time periods, you can use the ranges property. This allows you to define start and end dates for the recurrence. For example, to create an event that recurs every Monday and Thursday from 7:00 AM to 9:00 AM, but only during the month of March 2023, you would use the following code:

events: [{
    title: "March Availability",
    start: '07:00',
    end: '09:00',
    dow: [ 1, 4 ],
    ranges: [{
        start: '2023-03-01',
        end: '2023-03-31'
    }]
}]
Copy after login

Overnight Events

FullCalendar also supports handling events that extend beyond midnight. By setting the end time to a value greater than 24:00, you can create events that span overnight. For instance, to create an event that occurs every Saturday from 10:00 PM to 2:00 AM the following day, you would use the following code:

events: [{
    title: "Late Night Availability",
    start: '22:00',
    end: '02:00',
    dow: [ 6 ]
}]
Copy after login

The above is the detailed content of How Can I Schedule Recurring Events With Day-Specific Availability in FullCalendar?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template