Trouble setting default event end time
Posted: Thu Sep 02, 2010 1:20 pm
Hi John:
I followed the directions here:
http://www.seedcode.com/pmwiki/pmwiki.php?n=SeedCodeCalendar.EventDuration,
changing "1200" to "1800" to create a default event duration of 30 minutes. When creating new records this works fine. But when I edit an existing event's Start Time, the End Time remains unchanged. I want the End Time to "update" whenever the Start Time changes, to retain the default 30" duration. (I also want the Date End field to be modifiable, so that the user can "manually" enter any end time -- if she wants to make a given event last longer than 30" for example).
So here are the Events::Time End settings:
Field Type: Time
Formula/Entry Option:
Indexed, Auto-enter calculation: from Events, =
Let ( [
d = 1800 ; // Default event duration in seconds t = If ( IsEmpty ( Self ) and not IsEmpty ( TimeStart ) ; TimeStart + d ; Self ) ; t= Case ( t = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; t > Time ( 24 ; 0 ; 0 ) ; t - Time ( 24 ; 0 ; 0 ) ; t) ]; t )
Evaluate even if all referenced fields are empty, replaces existing value
How should I change this to get what I really want?
Yours,
Jim
I followed the directions here:
http://www.seedcode.com/pmwiki/pmwiki.php?n=SeedCodeCalendar.EventDuration,
changing "1200" to "1800" to create a default event duration of 30 minutes. When creating new records this works fine. But when I edit an existing event's Start Time, the End Time remains unchanged. I want the End Time to "update" whenever the Start Time changes, to retain the default 30" duration. (I also want the Date End field to be modifiable, so that the user can "manually" enter any end time -- if she wants to make a given event last longer than 30" for example).
So here are the Events::Time End settings:
Field Type: Time
Formula/Entry Option:
Indexed, Auto-enter calculation: from Events, =
Let ( [
d = 1800 ; // Default event duration in seconds t = If ( IsEmpty ( Self ) and not IsEmpty ( TimeStart ) ; TimeStart + d ; Self ) ; t= Case ( t = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ; t > Time ( 24 ; 0 ; 0 ) ; t - Time ( 24 ; 0 ; 0 ) ; t) ]; t )
Evaluate even if all referenced fields are empty, replaces existing value
How should I change this to get what I really want?
Yours,
Jim