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
Evaluating date expressions (Read 4017 times)
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Evaluating date expressions
Feb 27th, 2008, 8:39am
 
Here is an odd one that is perplexing me. In my to-do list, I have a facility for repeating actions. First there is a completion date-stamp attribute, then a string attribute which contains a duration directive in Tinderbox format. For example, a note might have these attributes:

Code:
SettingDueDate			2008-02-27 08:00
StatusCompleted			never
SettingRepeatInterval	1day 



When the note is marked as complete, StatusCompleted is set to today, and an agent detects that a note with a non-empty SettingRepeatInterval has been declared, and it increments the due date by the specified interval, setting the StatusCompleted attribute back to never. So in other words this would increment according to when it was originally due, not when it was completed. The advantage is that the set time will remain between resets.

Simple enough. However there is a secondary syntax for the repeat interval. This one increments by today instead of by the original. The syntax for that is simple: "=1day".

So the agent doing the collection and processing looks like this:

Code:
AgentQuery=Prototype(Action) & SettingDueDate != never & StatusCompleted != never & SettingRepeatInterval(^=?(.*)) 



With an AgentAction of:

Code:
if(SettingRepeatInterval(^=)) {
	SettingDueDate="today + " + $2;
	Test=$2;
} else {
	SettingDueDate=$SettingDueDate + $SettingRepeatInterval;
};
$StatusCompleted=never;Color=;Badge=; 



This works fine. The back-referenced $2 strips the '=' sign out of the designator and adds it to today. But what I want is to be able to retain the original time setting.

If I type `today +1day 8:00` into the quick stamp tool, this works, but if I specify `=1day 8:00` in the SettingRepeatInterval, the whole thing gets put into $2 as it should, but the new due date evaluates to the current time instead of the specified time.

The derived expression should be exactly how I am typing it in manually, I am tracking it with the Test attribute, but for some reason it isn't evaluating correctly.

Any ideas?
Back to top
 
 

Av
  IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: Evaluating date expressions
Reply #1 - Feb 27th, 2008, 5:50pm
 
Update:

I had some time to do some further experimentation on this. I set it up so that attribute Test gets set to precisely the same thing that SettingDueDate gets, `today + " " + $2`, and then placed a Rule which simply states `SettingDueDate=$Test`---and it works. So whatever is causing it to malfunction appears to be at a level beneath what I can access, since theoretically both Test and SettingDueDate are getting identical information. It doesn't make any sense to me that one would resolves as `2008-02-27 14:49` and the other as `2008-02-27 08:00`.
Back to top
 
 

Av
  IP Logged
Pages: 1
Send Topic Print