[Cosmo-dev] Item Deltas

Matthew Eernisse mde at osafoundation.org
Thu May 17 18:58:54 PDT 2007


Responses below, sir.

Bobby Rullo wrote:
> Are you sure you need that information? My understanding is that you 
> need to know if the recurrence has changed so you can see if it makes 
> sense to apply the change to an individual instance or not (i.e. it 
> doesn't make sense to apply add a recurrence rule to a single 
> occurrence) In this model that logic is encapsulated in the delta object 
> (isApplicableToJustOneOccurrence()) so that as we find more rules like 
> this we add them to the data model as opposed to in (potentially) 
> multiple places in the ui.

Actually, you're absolutely right -- we don't need that in the diff.

There are places in the code that care about the original value versus 
the changed value, but they're all grabbing the original value from the 
backup copy, not from the diff (duh).

You can do a search on dataOrig in the cosmo/view/cal.js to see what 
it's doing with those values.

> Could you explain what that (isOutOfIntervalRange) does a little more?

That's the function that looks to see if the edit of of a recurring 
event would take it outside the 'window' of that recurrence interval. It 
tells us whether the All or All Future edit scenarios are even logically 
possible. (Okay, they might be logically possible, but they're of 
dubious utility, and you'd have to make a bunch of arbitrary decisions 
about how to treat them.)

For example, if I have a daily recurrence, and I drag an occurence to 
the previous day, That function tells me I should only have the "Only 
This Event" option available because I have moved it outside the one-day 
interval for a daily recurrence.

Hope that answers all the questions.


Matthew


More information about the cosmo-dev mailing list