INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to format Date in 11.1?  (Read 3399 times)

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
How to format Date in 11.1?
« on: January 09, 2006, 03:34:06 am »

I couldn't find the release notes which explain this one... How does the date format work in 11.1 now? (for stuff like if [date imported] is-greater-than 7 days)

Thanks

Marty3d

  • Citizen of the Universe
  • *****
  • Posts: 1363
Re: How to format Date in 11.1?
« Reply #1 on: January 09, 2006, 04:03:45 am »

I'd like to know this as well....It seems that [Last Played]=>=20000 in a smartlist for example doesn't work anymore :(
Logged


marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8975
Re: How to format Date in 11.1?
« Reply #2 on: January 09, 2006, 04:30:19 am »

for stuff like if [date imported] is-greater-than 7 days

[date imported]=>7d
excludes files imported within the past seven days.

It seems that [Last Played]=>=20000 in a smartlist for example doesn't work anymore

[last played]=>=14d
excludes files played in the past two weeks.

I couldn't find the release notes which explain this one...

http://yabb.jriver.com/interact/index.php?topic=30193.0
MC 11.1 -- New syntax for search by date

Marty3d

  • Citizen of the Universe
  • *****
  • Posts: 1363
Re: How to format Date in 11.1?
« Reply #3 on: January 09, 2006, 04:33:21 am »

Thanks alot!
/Martin
Logged


EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #4 on: January 09, 2006, 04:38:33 am »

[date imported]=>7d
excludes files imported within the past seven days.

[last played]=>=14d
excludes files played in the past two weeks.

http://yabb.jriver.com/interact/index.php?topic=30193.0
MC 11.1 -- New syntax for search by date
Heh! I had a little bet with myself that it'd be you, Marko, who replied first on this one!!  ;D

Thanks!

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #5 on: January 09, 2006, 05:54:28 am »

New question on the same topic: I now have the problem that this doesn't work:

FormatDate([Date Imported], yyyy)

I just get either 1899 or 1900 - has something else changed in 11.1 that solves this?

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #6 on: January 09, 2006, 12:56:28 pm »

In another thread:
From what I can tell, [last played] will be automatically formated, so the FormatDate command doesn't work

I was messing around with my Expression a bit more, and discovered that it is only the year which doesn't get formatted properly. I have another Date Imported formatted:
Code: [Select]
FormatDate([Date Imported], MM//dd)Which works fine...
 ?

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8975
Re: How to format Date in 11.1?
« Reply #7 on: January 09, 2006, 01:41:18 pm »

skeeterfood provides the answer in the message you linked to.

try: formatdate([date imported,0],yyyy)

works for me here.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #8 on: January 09, 2006, 01:49:17 pm »

D'oh!
Works for me too! (Must remember to read full entries in future!)
 :-[

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #9 on: January 09, 2006, 04:20:02 pm »

I'll tentatively say that I have another problem now; I've tried numerous variations of this, and none of them will do what I expect:

If( [Date Imported]=>1y, FormatDate( [Date Imported,0], yyyy ), FormatDate( [Date Imported,0], yy//MM//dd ) )

All I get is a year; it ignores the 'if' part and just formats the imported date as a year, so I have all years from 2003 to 2006 in the pane. I've tested this using If( [Date Imported]=>1y, 1, 0 ) as well, and all I get is '1'. (I also tried if( [date imported,0]=>524160, ... as well as swapping =>1y and =>y1 - to no avail).

What am I missing?

skeeterfood

  • Citizen of the Universe
  • *****
  • Posts: 779
  • We're all just food for the skeeters.
Re: How to format Date in 11.1?
« Reply #10 on: January 09, 2006, 04:51:39 pm »

I don't know, looks fine to me, but as I was messing around I came up with this Decade Expression:
Code: [Select]
Mid([Date],0,2)If(IsRange(FormatDate([Date,0],yy),00-09),00,If(IsRange(FormatDate([Date,0],yy),10-19),10,If(IsRange(FormatDate([Date,0],yy),20-29),20,If(IsRange(FormatDate([Date,0],yy),30-39),30,If(IsRange(FormatDate([Date,0],yy),40-49),40,If(IsRange(FormatDate([Date,0],yy),50-59),50,If(IsRange(FormatDate([Date,0],yy),60-69),60,If(IsRange(FormatDate([Date,0],yy),70-79),70,If(IsRange(FormatDate([Date,0],yy),80-89),80,If(IsRange(FormatDate([Date,0],yy),90-99),90))))))))))'s

Produces output like: 1970's, 2000's, ...

If you create it as a new calculated library field (I called it Decade), you can add it to a view scheme and it works with the new "Library Browser" mode :)

I have a feeling it might be kinda slow for a large library though...

I wonder if Mid([Date],2,4) or FormatDate([Date,0],yy) is faster?

-John
Logged

Marty3d

  • Citizen of the Universe
  • *****
  • Posts: 1363
Re: How to format Date in 11.1?
« Reply #11 on: January 09, 2006, 05:20:22 pm »

Lazy as I am, I promptly call for a wizard in MC interface, handling the new date implementation.
Just like the other dialogs when using search and smartlists.
This is getting kind of ridiculous...It shouldn't be this hard to use dates!
Logged


marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8975
Re: How to format Date in 11.1?
« Reply #12 on: January 11, 2006, 02:46:50 am »

I'll tentatively say that I have another problem now; I've tried numerous variations of this, and none of them will do what I expect:

If( [Date Imported]=>1y, FormatDate( [Date Imported,0], yyyy ), FormatDate( [Date Imported,0], yy//MM//dd ) )

All I get is a year; it ignores the 'if' part and just formats the imported date as a year, so I have all years from 2003 to 2006 in the pane. I've tested this using If( [Date Imported]=>1y, 1, 0 ) as well, and all I get is '1'. (I also tried if( [date imported,0]=>524160, ... as well as swapping =>1y and =>y1 - to no avail).

What am I missing?
EpF, just half an answer for now...

the way that If(...) works is...

If this expression---> (expression), is true, do this instructions if true otherwise, do this instructions if false)

so yours would kick off something like if(isrange([date imported],
a simple working example is the expression
if(isequal([rating],0,2),not rated,[rating]))
make a pane out that to see it in action.

that's half the answer. I don't have a working expression to offer you. I'm also inclined to think that it can't be done directly via an expression.
What you're asking is, if [date imported] is in the range of 0 to 1 years, then display this, and if not, then display that instead. You want to group the dates. If you load the standard [date imported] view item, you will notice that grouping is not available.

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: How to format Date in 11.1?
« Reply #13 on: January 11, 2006, 03:12:41 am »

EpF, just half an answer for now...

the way that If(...) works is...

If this expression---> (expression), is true, do this instructions if true otherwise, do this instructions if false)

so yours would kick off something like if(isrange([date imported],
a simple working example is the expression
if(isequal([rating],0,2),not rated,[rating]))
make a pane out that to see it in action.

that's half the answer. I don't have a working expression to offer you. I'm also inclined to think that it can't be done directly via an expression.
What you're asking is, if [date imported] is in the range of 0 to 1 years, then display this, and if not, then display that instead. You want to group
the dates. If you load the standard [date imported] view item, you will notice that grouping is not available.
My old 'Date Imported' expression was:
Code: [Select]
If(IsRange([Date Imported],1-38400), FormatDate([Date Imported], yyyy), If(IsRange([Date Imported],1-38655), FormatDate([Date Imported], yy//MM), FormatDate([Date Imported], yy//MM//dd))The problem was that as time went by, I'd have to edit the time ranges to reflect the new months and weeks, so I thought the new format of >7d etc. would be ideal; I'll have to look into it further...

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8975
Re: How to format Date in 11.1?
« Reply #14 on: January 11, 2006, 07:31:58 am »

why don't you look up my "recently imported" view in the "reinvent the wheel" thread and see if that would work for you.

It will need a little tweaking now that there's new syntax and no media library, but I reckon you've got enough there to set you off in the right direction.
You can either create an "all media" variety on the tree root, or create individual schemes in each media type node, it's up to you.

sometimes a good old smartlist based viewscheme is still the way to go. I see expressions as an extension of MC, not a replacement for anything particular within it.
Pages: [1]   Go Up