More > JRiver Media Center 21 for Mac

How to create a Pane Category to group by Date Imported

<< < (3/6) > >>

Afrosheen:
Hmm, the search string isn't working.  Is there a wikipage where I can learn to decipher the different parts of the string?  For instance, I'm not sure what the "8" is for at the end of the string or why there's a "-1" outside of the "now()" field.

blgentry:
Other than the rather advanced search string that Marko gave you, is the base functionality working?  Have you created a "this month", or "last 90 days" search that works?

Brian.

marko:
Let's get it working. You're in USA, right? So you do dates the wrong way around, right? ;)

Did you change the string to match your locale?
Basically, you want to look at how MC presents the [date imported] field, and mimic that. At a guess, yours will do mm/dd/yyyy, and if that's right, your search string will look like so:
[=isequal([date imported],formatdate(now(),MM//dd//yyyy),8)]=1

and

[=isequal([date imported],formatdate(math(now()-1),MM//dd//yyyy),8)]=1

Better now?

The how and why
There is a comprehensive wiki page here: http://wiki.jriver.com/index.php/Expression_Language

"What is the "8" for?"
the function now() returns the current date and time.
the function "formatdate(now(),dd//MM//yyyy)" takes the current date and presents it as day/month/year
[Date Imported] includes the date and time of import per file. We are not interested in the time, only the date.
the function "isequal()" compares the value for [date imported] and the formatted value for "now()". The "compare" can be carried out in various ways, and here, the "8" performs a sub-string compare, so if there's a match on day/month/year, the file gets listed.

"why there's a "-1" outside of the "now()" field"
The expression engine can do math. As we want files imported yesterday, we need to match on yesterday's date. We get at that by telling MC to "now() minus 1". Any results returned should all match imported yesterday, regardless of when the expression runs.

Simples eh ;)

-marko

Afrosheen:
Thanks marko!  Your post here helped.  I wasn't sure what I was trying to model the date string to until you told me to mimic the date that MC usually has.  So for me I formatted the string to:

--- Code: (Today) ---[=isequal([date imported],formatdate(now(),MM//dd//yy),8)]=1
--- End code ---


--- Code: (Yesterday) ---[=isequal([date imported],formatdate(math(now()-1),MM//dd//yy),8)]=1
--- End code ---

Afrosheen:
If I wanted to create a string that would provide me a range of dates, i.e. this week, last week, this year, last year, how would I go about creating such a string?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version