IPS Company Blog - 4.0 - Recurring calendar events > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

IPS Company Blog - 4.0 - Recurring calendar events

wersja drukowalna wersja Microsoft Word wersja HTML

IP.Calendar has supported basic recurring calendar events for many versions now.  You can create events that recur weekly, monthly or yearly in IP.Calendar, and they will automatically show up on their specified schedule.  While this capability is certainly useful, we felt it was time to enhance event recurrence capabilities in the next version of IP.Calendar.
New options
Recurring every week, month or year is useful, but there are many other ways events can recur and IP.Calendar has no provisions to accommodate those recurrence types in the 3.x IP.Calendar release.  For 4.0 we have added several new recurrence-based options to the calendar.
Recur daily, weekly, monthly or yearly
In addition to the three options available in previous versions, you can now configure events to recur daily.
Recurrence frequency
You are no longer restricted to recurring every week (or month or other time period).  You can now configure events to recur every 2 weeks, or every 3 months, or every 10 days, or whatever period of time you need to.
Weekly recurrence: days of the week
If your event recurs weekly, you can now specify the days of the week the event should recur on.  This means you can configure an event that recurs weekly on every Tuesday and Thursday, for instance.
Recurrence timeframe
In previous versions of IP.Calendar, the end date specified when the event should stop recurring.  In 4.0, the end date/time specifies when the original recurrence end date/time are.  This means you can have an event that lasts 2 days and recurs annually, for instance (in other words, recurring ranged events).  When configuring the event, you now have three options for specifying the recurrence information:

You can now configure events like Christmas which never end, you can configure meetings which have a certain number of occurrences before they are finished, and you can configure recurring events that end on a certain date. 
As you can see, the options have been greatly expanded to accommodate many more types of recurring events.

Some technical details
At a technical level, event recurrence data is stored as an "RRULE", just like the iCalendar specification will specify.  In fact, the data should be a 1:1 equivalent.  If you import iCalendar events which have recurrence capabilities not supported by calendar, those events will be skipped during the import routine (as they are presently), however there are now far fewer recurrence capabilities that are wholly unsupported.
By storing the exact RRULE value we have a few benefits over previous versions of Calendar: 
Using PHP you can easily find future event recurrence details using the nextOccurrence() method.
     * Find the next occurrence of an event starting from a specified start point
     * @param    IPScalendarDate        $date        Date to start from
     * @param    string                    $type        Type of date to check against (startDate or endDate)
     * @return    IPScalendarDate|NULL
    public function nextOccurrence( $date, $type='startDate' )
This instance method is run against a calendar event, passing in a date to find the next occurrence from.  You can look for either start date or end date.

Attached thumbnail(s)

  • Attached Image

śro, 19 luty 2014