Tinderbox Forum

Adornment pulling in notes by month

I’m trying to get an adornment to pull in notes by month. I’ve tried a number of queries, but no joy.

My date attribute is: $DateMessage

I’ve tried:

$DateMessage==date("July").format("M")
$DateMessage.date.format("M")=="July"
date($DateMessage).format("M")=="July"

And many variation on those themes!

Could somebody please reveal the proper syntax?

(I did look up date.format on the aTBref, but it comes up empty.)

Sorry to hear you are having problems. Assuming [sic] that $DateMessage is a Date-type attribute, then Date.month tells us we can get the calendar month of the year as a number in the range 1–12. So, for July, the value is 7. So try this as your adornment’s query:

$DateMessage.month==7

This works for me in v8.7.1

Your examples above were failing because you are trying to match a date/time (under the hood just a number of milliseconds from a reference date) to a text string. Unless the latter is a string holding the date/time number in full there is no match.

You could also use

$DateMessage.format("M")=="July"

I find the first seems more intuitive, but take your pick of what ever matches your thought process (and works)

Awesome! Thank you good sir! That did the job.

Can I also specify a note size when adding it to the adornment? ie height and width?

Yes, use the adornment’s $OnAdd action. For example:

$Height=4;$Width=6;
1 Like