Simple Google Calendar Outlook Events Block Widget

Mô tả

Simple block or widget to display events from a public google calendar, microsoft office outlook calendar or an other iCal file, in the style of your website.

This simple widget fetches events from a public google calendar (or other calendar in iCal format) and displays them in simple list allowing you to fully adapt to your website by applying all kinds of CSS.
Google offers some HTML snippets to embed your public Google Calendar into your website.
These are great, but as soon as you want to make a few adjustments to the styling, that goes beyond changing some colors, they’re not enough.

Plugin Features

  • Calendar block or widget to display appointments/events of a public Google calendar or other iCal file.
  • Block gives live preview in the editor and is not constrained to widget area. Old widget will be displayed in legacy widget block only in widget area.
  • Small footprint, uses only Google ID of the calendar, or ICS link for Outlook, or Url of iCal file, to get event information via iCal
  • Merge more calendars into one block
  • Manage events in Google Calendar, or other iCalendar source.
  • Fully adaptable to your website with CSS. Output in unordered list with Bootstrap 4 listgroup classes and toggle for details.
  • Choose date / time format in settings screen that best suits your website.
  • Displays per event DTSTART, DTEND, SUMMARY, LOCATION and DESCRIPTION. DTSTART is required other components are optional.
  • Displays most common repeating events. Frequency Yearly, Monthly, Weekly, Dayly (not Hourly, Minutely and smaller periods)
  • In the screenshot below: Left the block with default settings and clicked on one summary. Right with some adjusted settings.
    Adjusted settings for start with summary:
    Start with summary.: “true”
    Date format first line: “.<br>l jS of F”
    Enddate format first line: ” – l jS of F”
    Time format time summary line: ” G:i”
    Time format end time summary line: ” – G:i”
    Time format start time: “”
    Time format end time: “”
    Tag for summary: “strong”


  • Gets calendar events via iCal url or google calendar ID
  • Merge more calendars into one block
  • Displays selected number of events, or events in a selected period from now as listgroup-items
  • Displays event start-date and summary; toggle details, description, start-, end-time, location.
  • Displays most common repeating events
  • Frequency Yearly, Monthly, Weekly, Dayly (not parsed Hourly, Minutely …), INTERVAL (default 1), WKST (default MO)
  • End of repeating by COUNT or UNTIL
  • By day month, monthday or setpos (BYDAY, BYMONTH, BYMONTHDAY, BYSETPOS) no other by…
  • Exclude events on EXDATE from repeat (after evaluating BYSETPOS)
  • Respects Timezone and Day Light Saving time. Build and tested with Iana timezones as used in php, Google, and Apple now also tested with Microsoft timezones and unknown timezones. For unknown timezone-names using the default timezone of WordPress (probably the local timezone).

Recurrent events, Timezone, Daylight Saving Time

Most users don’t worry about time zones. The timezonesettings for the WordPress installation, the calendar application and the events are all the same local time.
In that case this widget displays all the recurrent events with the same local times. The widget uses the properties of the starttime and duration (in seconds) of the first event to calculate the repeated events. Only when a calculated time is removed during the transition from ST (standard time, wintertime) to DST (daylight saving time, summertime) by turning the clock forward one hour, both the times of the event (in case the starttime is in the transition period) or only the endtime (in case only the endtime is in the transition period) of the event are pushed forward with that same amount.
But because the transition period is usually very early in the morning, few events will be affected by it.
If a calculated day does not exist (i.e. February 30), the event will not be displayed. (Formally this should also happen to the time in the transition from ST to DST)

For users in countries that span more time zones, or users with international events the calendar applications can add a timezone to the event times. So users in other timezones will see the event in the local time in there timezone (as set in timezone settings of WordPress) corresponding with the time.
The widget uses the starttime, the timezone of the starttime and the duration in seconds of the starting event as starting point for the calculation of repeating events. So if the events startime timezone does’not use daylight savings time and and timezone of the widget (i.e. the WP timezone setting) does. During DST the events are placed an hour later than during ST. (more precisely shift with the local time shift). Similar the events will be shift earlier when the timezone of the starttime has DST and the timezone of the widget not.

Of course the same effect is achieved when you schedule the events in UTC time despite using local time DST in your standard calendar.
In these cases, a special effect can be seen of using the same times twice in the transition from DST to ST. If an event lasts less than an hour. If the event starts in the last hour of DST then it ends in the first hour of ST in between the local clocks are turned back one hour. According to the local clock, the end time is therefore before the start time. And the widget shows it like this too. The same also applies to Google and Outlook calendar.
Theoretically this could als happen with recurrent events in the same timezone with DST. In my test I have seen this with Google calendar but not with the widget. PHP and therefore the widget uses the second occurence if the result of the calculation is a time that is twice available (at least in the version of PHP I use), but using the first occurence like Google does is just as good.

Test results and comparison with Google and Outlook calendar have been uploaded as DayLightSavingTime test.xlsx.

From the ical specifications

see for specification of te ical format.
(see 3.3.10. [Page 38] Recurrence Rule in specification
  |            |DAILY    |WEEKLY  |MONTHLY  |YEARLY  |
  |BYMONTH     |Limit    |Limit   |Limit    |Expand  |
  |BYMONTHDAY  |Limit    |N/A     |Expand   |Expand  |
  |BYDAY       |Limit    |Expand  |Note 1   |Note 2  |
  |BYSETPOS    |Limit    |Limit   |Limit    |Limit   |

    Note 1:  Limit if BYMONTHDAY is present; 
             otherwise, special expand for MONTHLY.

    Note 2:  Limit if BYYEARDAY or BYMONTHDAY is present; otherwise,
             special expand for WEEKLY if BYWEEKNO present; otherwise,
             special expand for MONTHLY if BYMONTH present; otherwise,
             special expand for YEARLY.

(This widget is a Fork of version 0.7 of that simple google calendar widget by NBoehr

Copyright and License

This project is licensed under the GNU GPL, version 2 or later.
2017 – 2022 © Bram Waasdorp.

Rate this post

Hãy bình luận đầu tiên

Để lại một phản hồi

Thư điện tử của bạn sẽ không được hiện thị công khai.