Contribute to JEvents

SOLVED - Bug report: Importing ical file with RRULE weekly

We are looking for developers, forum moderators and translators for this project.

If you would like to help out then please add a message in this forum.

Postby arthurbaars » Mon Apr 02, 2012 4:33 pm

When I try to import the ical file below, Jevents version 2.1.12 creates an event with this data:
  • from: 20071207, at 00:00 (should be 1500)
  • to: 20071207, at 00:00 (should be 1800)
  • by date: thursday (should be friday)

It seems that Jevents incorrectly calculates that 20071207 is a thursday, while in fact it is a friday. After explicitly adding ";BYDATE:FR" to the ical event, Jevents does import the right data (both the bydate and the start/end times)

Code: Select all
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Amsterdam
X-LIC-LOCATION:Europe/Amsterdam
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20071205T101029Z
LAST-MODIFIED:20120302T112412Z
DTSTAMP:20120302T112412Z
UID:33c1680c-1ad1-447e-9a34-aedf50f1e37c
SUMMARY:Some Description
RRULE:FREQ=WEEKLY;INTERVAL=1
DTSTART;TZID=Europe/Amsterdam:20071207T150000
DTEND;TZID=Europe/Amsterdam:20071207T180000
TRANSP:OPAQUE
LOCATION:Somewhere
X-MOZ-GENERATION:162
END:VEVENT
END:VCALENDAR
Attachments
test1.png
screenshot of imported event
test1.png (62.56 KiB) Viewed 1471 times
arthurbaars
 
Posts: 9
Joined: Mon Apr 02, 2012 4:08 pm

Postby carcam » Tue Apr 03, 2012 6:04 am

Hi arthurbaars,
did you configure your timezone settings in the ical import/export tab at JEvents configuration?

By the way, you should also update your JEvents installation to the latest 2.1.14 version to be sure you are in the most up to date version of the software ;o)
¿Sabías que tenemos soporte en español para los miembros del Club de JEvents? ¡ÚNETE AHORA!
User avatar
carcam
Team Staff
 
Posts: 7061
Joined: Wed Aug 06, 2008 7:50 pm
Location: Almería

Postby arthurbaars » Tue Apr 03, 2012 7:39 am

My timezone is Europe/Amsterdam, in the component settings and in the import/export settings.

I upgraded to JEvents 2.1.14/ Joomla 2.5.4, and the problem persists. The edit view still looks like the attachment. The curious thing is that the times are correct in the "timesheet" on the "Manage Events" overview.

PS. in my initial post i wrote "BYDATE=FR", this should of course be "BYDAY=FR"
arthurbaars
 
Posts: 9
Joined: Mon Apr 02, 2012 4:08 pm

Postby Geraint » Tue Apr 03, 2012 8:52 am

Supporting every combination of explicit and implicit value of RRULE values when importing is not easy (as I'm sure you can imagine).

I've not come across an export WEEKLY where BYDAY was not set before now so hadn't dealt with this eventuality.

If you add this code at line 691 of components/com_jevents/libraries/iCalRRule.php (just after currentWeekStart is defined) it should solve this problem

Code: Select all
            // no BYDAY specified
            if ($this->byday==""){
               $daynames = array("SU","MO","TU","WE","TH","FR","SA","SU");
               $this->byday = "+".$daynames[$currentWeekDay];
               $days = array($this->byday) ;
            }


thanks for the detective work - the fix will be in the next release
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42781
Joined: Fri Feb 15, 2008 6:14 pm

Postby arthurbaars » Tue Apr 03, 2012 9:03 am

You're welcome. Thanks a lot for the patch.
arthurbaars
 
Posts: 9
Joined: Mon Apr 02, 2012 4:08 pm


Return to Contribute to JEvents

  • Who is online
  • View new posts
  • View unanswered posts
  • In total there are 0 users online :: 0 registered and 0 hidden (based on users active over the past 5 minutes)
  • Most users ever online was 94 on Tue Sep 01, 2009 12:33 am
  • Users browsing this forum: No registered users