Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Hopefully quick date arithmetic query (Read 6117 times)
Rob Forsyth
Full Member
*
Offline



Posts: 63

Hopefully quick date arithmetic query
Sep 17th, 2008, 9:01pm
 
Can someone help me to the correct syntax for this rule:

GoalDueDate=$AdmissionDate(parent)+14 days

doesn't give the hoped-for result (i.e. to set GoalDueDate to 14 days later than its parent's $AdmissionDate)
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Hopefully quick date arithmetic query
Reply #1 - Sep 18th, 2008, 4:22am
 
I can replicate the problem. I tried brackets () around the sub-clauses to try and help YB with the order things are evaluated but that didn't help. So, I tried an extra Date-type attribute 'ExtraDate' into my test Rule:

  ExtraDate = $AdmissionDate(parent); $GoalDueDate = $ExtraDate + 14 days

Instead of getting 'never' as the result I now get a date but the wrong one.  If the parent's AdmissionDate is 2/9/08 (2 Sep - I'm in UK), the GoalDueDate of the child is 14/9/08 and not 16/9/08 as I'd expect.  It seems there is a further problem with the dates here as if I change the amount of tme added to '4 days' the result is 4/9/08. If I use '6 weeks' the result is 6/9/08. It seems the whatever extra I add (days/months/years) the number preceding that is simply set as the target date attribute's day number and not added to it.

Adding a placeholder duration to a date date attribute is allowable syntax as far as I can tell. Release note seq #1207 for version 3.0.3 has this example code:
  DueDate=$DueDate(parent)+7 days;

Back to top
 
« Last Edit: Sep 18th, 2008, 12:22pm by Mark Bernstein »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Hopefully quick date arithmetic query
Reply #2 - Sep 18th, 2008, 12:21pm
 
The syntax is right; Tinderbox 4.5 is wrong.  (It's a glitch connected to historical date support, and will be fixed in 4.5.2)
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print