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
Note appearing in two (supposedly) exclusive agent (Read 7415 times)
Matt Cawood
Full Member
*
Offline



Posts: 109
New England, Australia
Note appearing in two (supposedly) exclusive agent
May 8th, 2008, 5:15pm
 
I have agents for a date attribute, 'deadline'. One is for capturing and flagging (with a border colour) deadlines cropping up in the next three days:

deadline=today | deadline=today+1 | deadline=today+2 | deadline=today+3

(I know this is horribly inelegant, but it worked when I was in a hurry and I haven't bothered to change it. )

Plus another agent for flagging deadlines that have whooshed past, as Douglas Adams so beautifully put it:

deadline<today

Why would the same note appear in both these agents? Aren't they asking different things?

-addendum-

I used some imagination and amended the first agent to read:

deadline<today+3 & (! #inside(áDeadlinePast))


Now a note with a deadline for today doesn't appear in the above agent (which I thought would capture it), because it's in the "DeadlinePast" agent, and so excluded.

-further addendum-

...so I modified the "DeadlinePast" agent to read:

deadline<today & deadline≠today

and it all works.

But for future reference, how does Tinderbox interpret today's date against the '<' operator?

Matt
Back to top
 
« Last Edit: May 08th, 2008, 5:17pm by Matt Cawood »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Note appearing in two (supposedly) exclusive agent
Reply #1 - May 8th, 2008, 6:05pm
 
Experimentation shows that in the context of 'today', time is taken into account.  Deadline < today is finding a note made to test your question this afternoon (in UK) - the time is 14:48. It's now 22:40. If I change the latter note's time (date stays the same) to 23:40 it's now excluded.

Doh! I didn't read the full section I quoted from the manual (I don't use dates a lot). Manual p.114, section "Agents, Dates and times":
Quote:
Agents regard two dates as being equal if they share the same year, month, and day -- regardless of the time of day.

The comparison operators >, >=, < and <= compare both date and time, so the same note could be found by two agents: one that locates theDate < todayand another that searches for theDate = today.

What's catching you out is '=' acts differently in that it ignores time unlike other comparison operators.

So time does matter but, as already discussed default time is always 00:00 unless you set it manually or through some string. I found this worked as as a test agent action:
MyDate = yesterday 09:00
..and my date attribute duly had a date of yesterday and time of 09:00. I suspect local setting for time/date may have some bearing on the time format.  Here in UK (UK OS settings in 10.4.11) I'm doing fine with 24hr hours and with a colon hour/minute delimiter.
Back to top
 
 

--
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: Note appearing in two (supposedly) exclusive agent
Reply #2 - May 8th, 2008, 6:09pm
 
Why does = ignore time?

Because, if it compared dates and times, two dates would only be equal if they were EXACTLY the same moment.  In practice, this means a date is only equal to itself.  This isn't very useful!

(In early versions of Tinderbox, date equality was defined to take time into account.)
Back to top
 
 
WWW   IP Logged
Matt Cawood
Full Member
*
Offline



Posts: 109
New England, Australia
Re: Note appearing in two (supposedly) exclusive agent
Reply #3 - May 8th, 2008, 7:05pm
 
Is time necessary on a date attribute? Could the date attribute be simplified to only include a date, which means anytime between 12.00.01 am and midnight on a particular day? Could time be a separate attribute?

Time is irrelavant to the way I work with dates--a day is fine-grained enough for me--but I'm guessing it's integral to Tinderboxes's calculations.

Matt


Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Note appearing in two (supposedly) exclusive agent
Reply #4 - May 8th, 2008, 7:19pm
 
A date is always a specific day and time.  The equality operator "=" is special, in that ignores time of day; all other operators take time into account.

Notice that you can extract the day, month and year from a Date separately if you need to.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Note appearing in two (supposedly) exclusive agent
Reply #5 - May 9th, 2008, 4:11am
 
So the time-insensitive version of
Deadline > yesterday
is
Deadline > day(yesterday)+"/"+"month(yesterday)+"/"year(yesterday)
...(readers with US settings reverse day & month argument)

The latter syntax seems verbose for regular use (and I can't get it to work**). Perhaps those seeking time-insensitive date/time comparison would benefit from an additional date operator allowing a concise version of the above syntax, e.g.
Deadline > dateonly(yesterday)

IOW, for a today of '09/05/2008 09:07', it would return '09/05/2008'

** Presumably because I'm trying to compare a string with a date/time.

I note with interest we've parallel threads with the GTD-ers wanting both time-sensitive and time-insensitive (or rather timeless) comparisons within the GTD context.
Back to top
 
« Last Edit: May 9th, 2008, 5:54am by Mark Anderson »  

--
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: Note appearing in two (supposedly) exclusive agent
Reply #6 - May 9th, 2008, 2:01pm
 
Summary: comparing dates

= compares the calendar day only. †Date1=Date2 is true if the calendar date of Date1 and Date2 are the same, even if Date1 and Date2 are different times.

Other comparison operators compare dates and times. †

Example: if you want to find tasks that are due before the close of business tomorrow, you can search for "DueDate<tommorow 6:00PM"

(The date parser recognizes 6:00PM, but not 6PM.)
Back to top
 
« Last Edit: May 9th, 2008, 2:06pm by Mark Bernstein »  
WWW   IP Logged
Pages: 1
Send Topic Print