Forum OpenACS Development: Confusing calendar behavior with recurring events.

I noticed that acs-events when applying changes to a recurring event, applies the time as an offset from the original time to the new time. This works fine as long as none of the recurring events has had its time changed. If it has you will be a strange result.

I believe the expected behavior when setting a time and choosing apply to all events with a recurring event, is that each event will happen at that time.

This is easy enough to fix. This example code works

PERFORM time_interval__edit(v_timespan.interval_id,
(to_char(v_timespan.start_date,''yyyy-mm-dd'') || '' '' || to_char(p_start_date,''hh24:mi:ss'')) :: timestamptz, (to_char(v_timespan.end_date,''yyyy-mm-dd'') || '' '' || to_char(p_end_date,''hh24:mi:ss'')) :: timestamptz);

I suspect the same thing would work on Oracle (I'll test it later, Oracle + VMWare crashes my laptop)

Anyone have any comments, questions, suggestions about this? If not I think this is a bug and I'll commit these changes.

Collapse
Posted by Gustaf Neumann on
Let me rephrase: One has a recurring event (e.g. for April, starting every day at 9am), and changes just for April 7 the starting date to 9:30 (no recurrence). So far, everything is fine.

If now someone alters the recurring event to 10am, starting with April 1, then every day will have the starting time 10am, except April 7, which has now 10:30. This is not expected and happens due to the relative time change in the implementation.

However, the current implementation cares for DST shifts. If within a recurring event the DST changes, then it can be the case that for a few days, the starting time is e.g. 9am and for some later events, it is 10am). In an international setup, this might be the right thing (people in other timezones might have no idea, when the timezones of their partners changes). However, for a local setup (e.g. starting time of a course), this does not make sense, since the course will effectively starts e.g. one hour earlier due the DST shift. The recurring rule should have actually a flag, stating universal time or localtime).

Dave, your suggestion will kill the DST shift feature. In my point of view, the defensible semantics for the above situation (rule + 1 day exception) is: if the rule changes, leave out the events which are out of the recurring rule (which got separate times). This means, change just the events, for which the actual start and end times are equal to those generated by the original recurrence rule. I see this from the classic AI (or OO) point of view: The rule says, start every day at time X. There is an exception on April 7, therefor the fact. If the rule changes, nothing is said about the exception.

However, there is an second problem with the implementation of the recurring events: suppose, in the above example, we go to April 20, and we edit this entry and alter its start time to 11am (with recurrences).

The effect of the current implementation is that the older dates of the rule (before April 20) are effected as well (even dates in the past, one cannot change events, that already have happened). This is as well unexpected behavior. I think, a defensible semantics would be that the change on April 20 ends the old recurrence rule and start a new one with the altered dates.

Collapse
Posted by Dave Bauer on
Gustaf,

I think currently the recurring events will stay at the same time, when crossing from standard to daylight saving time. I made this change a while ago, but there was a missing upgrade script. It should show up in the next release of acs-events.

I am also working on the ability to edit only future events as an additional option.

Collapse
Posted by Dave Bauer on
The idea of a recurring event having a flag, local or universal time is interesting. Really all events should have that. Right now, I believe events are stored with the system timezone exclusively. But only on PostgreSQL. No timezone data is stored on Oracle installs.

Probably the correct behavior is to allow setting the timezone of the event for every event. Then the local time of the event could be chosen and could be displayed in the calendar.

There is an almost infinite number of ways to tweak the behavior of the calendar. It all depends on what a user expects. I am basically comparing other calendar software, hoping those developers have done the research into what is best for most users.

Collapse
Posted by Dave Bauer on
Gustaf, I am sort of confused.

Maybe folks are using calendars in a different way.
My users are stating that during standard time and DST the event's time does not change. So during standard time the event is at 9am. After DST its still at 9am.

Now technically these are two different times. But real people couldn't care less. They want to know, on the day of the event, what time the event starts. So no matter what the timezone offset of the event stored in the database, the event should appear at local time.

If an event actually changes frm 9am to 10am then it should be reflected in the data stored in the database.

So I am just reporting that I had users complain that their evets mysteriously changed time on March 11 (DST In the US) and I need to fix it so it works as they need it to.

Collapse
Posted by Gustaf Neumann on
Dave, i am confused by your statements as well.


My users are stating that during standard time and DST the event's time does not change

The event's time of recurring events? Maybe we have missed an update, but the behavior of our large installation is exactly as i described: I added a recurring event for every day starting on march 1 running until end of April at 8am. The generated events are from April 1 to April 24 at 8 am, then starting at March 25 (when our DST started) it switches to 9am until end of April.


But real people couldn't care less.

It depends: in an international setup this makes perfectly sense. It is actually the only possible way, when e.g. three people in three different time-zones work together. These real people don't care about the time-zones the other people are in, but they want to meet in a chat at the same time.


So I am just reporting that I had users complain that their evets mysteriously changed time on March 11
Three paragraphs earlier, you state that the events time did not change. Are you saying, that recurring events did not change, but single events changed their time?
Collapse
Posted by Dave Bauer on
Dave, i am confused by your statements as well.

... My users are stating that during standard time and DST the event's time does not change ...

The event's time of recurring events? Maybe we have missed an update, but the behavior of our large installation is exactly as i described: I added a recurring event for every day starting on march 1 running until end of April at 8am. The generated events are from April 1 to April 24 at 8 am, then starting at March 25 (when our DST started) it switches to 9am until end of April.

I fixed this. It was in acs-events but there was no upgrade script. I checked in an upgrade on Friday that should be in the next release of acs-events.

But real people couldn't care less.

It depends: in an international setup this makes perfectly sense. It is actually the only possible way, when e.g. three people in three different time-zones work together. These real people don't care about the time-zones the other people are in, but they want to meet in a chat at the same time.

Right this is totally true. The calendar software (and especially the Oracle datamodel) does not allow setting of the timezone of an event. So you can only enter an event in the system timezone. (It does not use the user's preferred timezone.)

So I am just reporting that I had users complain that their evets mysteriously changed time on March 11

That is the display of the events on the calendar changed, but the schduled time they expected to see on the calendar did not.

Let me clarify again, the scheduled time of the event does not change. ie: 9am EST, and 9am EDT. To the computer these are different times. But the users want to see "9am".

Collapse
Posted by Dave Bauer on
So issues in acs-events and calendar are

1) Oracle does not store timezone data
2) PostgreSQL stores timezone data, but the user can never set the timezone. It uses the system timezone of the operating system/PostgreSQL
3) Individually edited recurring events result in inconsistent behavior, the system is not coded to handle them in any way.
4) The system never displays the timezone, especially if its different than the currently displayed timezone.
5) You can't edit only future events in calendar ( I have code to fix this, the acs-events part is checked into CVS. The UI changes can go in anytime.)
6) recurring events across DST boundaries change time when they should not. (This is fixed for new installs as of 5.2, and upgrades from oacs-5-3 cvs acs-events package )

Anything else?

These are seperate but interconnected issues. Fixig one can change the behavior of the other issues in unexpected ways. We need to define what acs-events, and the calendar package are supposed to

I'll have to test some more example calendar packages. I checked, Google Calendar, for one, and editing a recurring event time resets the time for all instances of the event. Yahoo calendar behaves the same way. I don't have any other calendar software handy. If anyone can test on Outlook or Palm OS calendars, that would be useful.