stephenharris/Event-Organiser

Duration calculation incorrect (PHP bug 52480)

stephenharris opened this issue · 0 comments

This bug took the form of an incorrect end date. When calculating occurrence start and end dates, Event Organiser generates the start dates according to the given schedule (if any), and calculates the end dates of those occurrences by using those duration of the first date.

That duration calculation can be incorrect ( a la date_diff(), see PHP bug 52480) resulting in incorrect end dates. The problem affects users with

  • PHP 5.3+
  • Timezone set to something other than UTC
  • Events where the start/end date is close to the beginning/end of a month.

Fortunately the plug-in for php 5.2 installs, the plug-in calculates duration in php 5.2 friendly way (date_diff() requires php 5.3+). So the fix is simply to use that workaround for all versions.