Have you ever wondered how to represent important recurring events like a ‘payday’ or a last business day?
If your calendar application allows you to enter the “set position” along with other recurring rules, then you’ll need to know about BYSETPOS.
In a ical recurring event, the BYSETPOS is a comma separated list of numbers (1 to 366 or -1 to -366). It MUST be used with another ‘BY’ rule such as BYDAY, BYMONTH etc.
It “chooses” the ‘nth’ occurrence within a set of dates determined by the preceding rules.
For example, in a WEEKLY rule, the interval would be one week. (Remember to consider what the “start of the week” is for the set you are using). A set of recurrence instances starts at the beginning of the interval defined by the FREQ rule part.
For the formal definition see http://www.ietf.org/rfc/rfc5545.txt
The last work day of the month
‘PAY DAY’ – the last week day in the month!
The 30th of every month; or the last day of the month if the 30th doesn’t exist
According to the very useful table of recurring rule precedence of page 43, the BYSETPOS is applied last within an iteration of the ‘FREQ’ on the set of dates generated by the rule. If you programmaticaly follow the table logic, you should be able to avoid problems implementing BYSETPOS.
Some ics files (eg: a zimbra file) I have encountered have the TZID enclosed in quotes.
The usual use (google calendar etc) is:
The spec examples do not show quotes and the quotes in the terminology definition are not I think meant to be included in the data. However this is relatively easy to deal with, so the next version of the plugin > 2.9.4 will cope with these.
Please note that the plugin currently ignores the VTIMEZONE in the ics file and uses the php database timezone.
The plugin will also not cope with the following yet (I have not yet encountered an ics file with it’s own timezone identifiers yet!):
fictitious globally unique time zone identifier example:
Some considerations in choosing a plugin or script to import one or more shared calendar ical feeds:
- Completeness and/or robustness of ical implementation? vs type of dates expected by your application. A complete implementation may of necessity be more complex than a simple one. If your dates are simple, may be a simple solution is the answer. Or do you need to allow for all the variations of recurring specifications?
- Does it cater for all the fields you need? (attendees etc….)
- Box Calendar or List of Events (Agenda Style)
- Verbose or concise text (eg: Mo, Tu vs Monday, Tuesday)
- Explanatory Text options to change?
- Hardcoded english? or are there language translation options?
- Possibilities for css styling – does the html code produced allow adequate styling opportunities?
- Caching? If you have a high volume site, or you want the calendar or agenda in your sidebar, then you need to cache the ics file to avoid placing too much of a load on the server that is hosting the ics file (and slowing down your site)
- Can it handle or combine multiple calendars?
- Will it repeat the recurring events per day? or does it note the fact that they repeat on the first day or the current day?
WordPress Ical (ics file) import options:
These are ‘old’ – please see http://webdesign.anmari.com/95/comparison-of-event-calendar-plug-ins/
- http://wordpress.org/extend/plugins/wordpress-ics-importer/ This one looks good, not a full implementation of the code, but the code that is there is well structured, allowing for additional implementation in a clean fashion. Provides a cache. No language translation and alternative css and html options are possible, but not that obvious or easy until you dig into the code. One calendar at a time.
http://webdesign.anmari.com/icalevents-table/ an off shoot of the next one Adam Gordons, but with alternative html layout and additional css tags for custom styling, etc). Working on translation and additional formatting options, and a standalone test. Both handle multiple calendars.
http://webdesign.anmari.com/web-tools/plugins-and-widgets/ical-events-list/ Better version of the above (more robust, more styling, still not repeating, but may be adding that soon).
http://wordpress.org/extend/plugins/ical-events/ Well written, handles a fair bit of the Ical Spec, could use a layer of “wordpress presentation” ie plugin customisation page and widget.
http://www.xvx.ca/icalevents/ (Adam Gordons) , No cache. Hardcoded English. Offers a
http://code.google.com/p/wpng-calendar/ and some info on using it. Has a widget option.
http://wordpress.org/extend/plugins/upcoming-events/#post-315 Does not handle recurring events. Has cache, and can handle multiple feeds. Has a widget option.