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
Has date expressions language changed? (Read 2428 times)
mrkwr
Full Member
*
Offline



Posts: 75

Has date expressions language changed?
Jun 16th, 2014, 7:47am
 
Many of by Tbx5 documents have an agent to collect recently added/modified notes, using this query:

   Created>(today-7)|Modified>(today-7)

This doesn't work for me in Tbx6 (it selects lots of notes that don't meet the criteria). Am I doing something wrong or has the language for date expressions changed?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Has date expressions language changed?
Reply #1 - Jun 16th, 2014, 8:26am
 
Lots of legacy syntax there so TB may be getting confused. I think you need:

$Created>date("today-7 days")|$Modified>date("today-7 days")

- attribute references should have a $-prefix.

- date() makes Date-type data objects on the fly, better for comparison with Date-type attributes.

- the strings used in date() are quoted.

- the type of quantity being added/subtracted should be given, e.g. days/months/years. Incidentally singular or plural versions should work: day/days month/months year/years.

Edited:
Updated to reflect MB's post below.
Back to top
 
« Last Edit: Jun 16th, 2014, 10:25am 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: Has date expressions language changed?
Reply #2 - Jun 16th, 2014, 10:16am
 
Please use "today+7 days" rather than "today+7"; they do mean the same thing, but it's much clearer and safer to specify. Note that you might also write "today + 7 weeks" or "today+7 months".
Back to top
 
 
WWW   IP Logged
mrkwr
Full Member
*
Offline



Posts: 75

Re: Has date expressions language changed?
Reply #3 - Jun 16th, 2014, 4:13pm
 
Thanks! Yes, that code's been just copied/pasted since I first started using Tbx (it's in my most-regularly used Favourite template, for instance). Now I come to look, I've found that while it works fine in some of my Tbx5 documents, it misbehaviours in others, so this is a good moment to check my older stuff.
Back to top
 
 
  IP Logged
mrkwr
Full Member
*
Offline



Posts: 75

Re: Has date expressions language changed?
Reply #4 - Jun 16th, 2014, 4:24pm
 
Ah, I've also discovered another reason why I was having problems with this.

I *think* it must be that when I accidentally opened the Tbx5 document in Tbx6 (rather than the duplicated version I'm currently using for testing until I'm comfortable with Tbx6), Tbx6 modified a large number of the notes (perhaps because they had external HTML templates)?

This is a bit annoying (though not really critical here), since it means I've lost the "modified" history on 1229 notes in my daily work journal, so something to watch out for it this matters to you (assuming I'm reading this right).
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Has date expressions language changed?
Reply #5 - Jun 16th, 2014, 4:45pm
 
It's always difficult when in transition across versions. I tend to add a version number, e.g. a '6', to the end or beginning of file names. I then know that aTbRef should not be open in v6, and aTbRef6 not be open in v5. It's not foolproof but I've done this a number of times and it cuts down on accidentally opening the wrong file. Plus, at this 'switchover' time I try to train myself to never double-click files but either drag files to the app in the dock or use the file menu from in the app (oh, and v6 users can use the dock content menu to access recently used files).
Back to top
 
« Last Edit: Jun 16th, 2014, 4:45pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print