Page 1 of 1

Setting event duration

PostPosted: Sat Dec 08, 2012 10:17 am
by wbullard
I've set the Sample Events::EndTime using calculation show here: http://www.seedcode.com/pmwiki/pmwiki.p ... ntDuration, but it doesn't work in my application. Nor does it appear to work in the source program that you provide. In both programs the end time comes up as 12:00 AM.

Re: Setting event duration

PostPosted: Mon Dec 10, 2012 12:16 pm
by JasonYoung
Hi Will,

I think I see the issue :oops:

Try this one:

Let ( [
d = 1200 ; // Default event duration in seconds
t = If ( not IsEmpty ( TimeStart ) ; TimeStart + d ; "" ) ;
t =
Case ( t = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ;
t = Time ( 0 ; 0 ; 0 ) ; Time ( 0 ; 0 ; 1 ) ;
t > Time ( 24 ; 0 ; 0 ) ; t - Time ( 24 ; 0 ; 0 ) + 1 ;
t ) ] ;
t
)

I'm going to have John double check, then we'll update the docs.

Thanks for reporting this...if we had t-shirts, we'd send you one! 8)

-Jason