INTERACT FORUM

Please login or register.

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

Author Topic: "Fields are formatted by default now"  (Read 8367 times)

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941
"Fields are formatted by default now"
« on: January 06, 2006, 03:12:34 pm »

Fields are formatted by default now so you don't need the extra Format(...) function.  If you need raw data, do [File Size, 0] or Field(File Size, 0).  The DevZone has the full details.

I still think it's broken Matt..

I got the [file size] thing sorted, but not the FormatDate([...],elapsed)

I'm trying to use formatdate([last played],elapsed) and it's not working. I checked the dev zone (thanks for updating) and tested again using the example given there:
FormatDate([Date Imported], elapsed)
and it behaves in the same strange way that it does for [last played]

any ideas?

skeeterfood

  • Citizen of the Universe
  • *****
  • Posts: 779
  • We're all just food for the skeeters.
Re: "Fields are formatted by default now"
« Reply #1 on: January 06, 2006, 05:49:26 pm »

Did you try FormatDate([last played, 0], elapsed)?

From what I can tell, [last played] will be automatically formated, so the FormatDate command doesn't work, but [last played, 0] is the RAW data and should format correctly.  I'm at work, so I can't test it...

I'd love to see some more documentation on the custom date format charaters available...

-John
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941
Re: "Fields are formatted by default now"
« Reply #2 on: January 07, 2006, 05:27:32 am »

thank you skeeterfood.

I had tried [last played],0

It did not occur to me that we were effectively looking at a new field.

this quote from the newly updated dev zone page presumably needs a little revision...

Quote
FormatDate(...): Formats a date value in a specified manner.

    Value: the date to format
    Formatting: formatting style

        Year: 1997
        Month: March
        Day: 12
        Filename: 20040521-032221
        Elapsed: 3.2 days ago
        Other: flexible formatting (i.e. MMMM-d)

    No Date Output: the output when the date is empty (optional: defaults to nothing)

    Examples:
    FormatDate([Date Imported], elapsed)
    FormatDate([Date], MMMM: d, no date)
or am i just reading it wrong?

skeeterfood

  • Citizen of the Universe
  • *****
  • Posts: 779
  • We're all just food for the skeeters.
Re: "Fields are formatted by default now"
« Reply #3 on: January 09, 2006, 04:16:19 pm »

I agree it needs a bit of tweaking.  It would also be nice to know more details about what's available for the flexible formatting...

Here's another problem I have:
for albums with the years 1970, 1989, 2000, 2005
FormatDate([Date,0],yy) gives
00
05
70
89
as expected

FormatRange(FormatDate([Date,0],yy),10,2) gives
(Others) - Contains 2000
0-9         - Contains 1970, 1989, 2005
70-79     - Contains 1970
80-89     - Contains 1989

All I can say is Huh?

-John
Logged

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #4 on: January 14, 2006, 11:10:38 am »

Thanks for the update on the Last Played Field.  But how can I change PlayingNow to show the same Last Played date format that I changed in MC?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941
Re: "Fields are formatted by default now"
« Reply #5 on: January 14, 2006, 03:06:36 pm »

if you're talking about rhinobanga's plugin, you'd need to create a calculated field using the formatdate expression, then edit the skins ini file to display that new field.

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #6 on: January 14, 2006, 03:23:18 pm »

I tried to put the new field in the skin by putting it in quotes, i.e. <"Last Played">  but it shows the date that I last played the song.  I tried creating a new field with the form in this thread, FormatDate([last played, 0], elapsed) with the name LPlayed, but when I refresh the plugin a dialog box opens saying, "The database field 'LPlayed' does not exist!" Then everything crashes. Any tips to fix this?
 

Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941
Re: "Fields are formatted by default now"
« Reply #7 on: January 14, 2006, 03:59:44 pm »

working fine here for me, see image below.

not sure why it won't work for you. you certain you made your field a "calculated value"?

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #8 on: January 14, 2006, 04:47:45 pm »

no i don't think I made a calculated field seeing that I'm much of a n00b for this sort of stuff.  Not sure what a calculated field is in the first place. 

All I did was go to customize current view, made an advanced expression with the title Last Played and the expression FormatDate([last played, 0], elapsed) and took that field and inserted it to the playingnow skin.ini like this <"Last Played">. 

Logged

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: "Fields are formatted by default now"
« Reply #9 on: January 14, 2006, 05:03:24 pm »

took that field and inserted it to the playingnow skin.ini like this <"Last Played">. 

I think the quotes are your problem - try this:
Code: [Select]
<Last Played>

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #10 on: January 14, 2006, 05:11:10 pm »

On the skin it just shows, <Last Played>.

When I put it in quotes it shows the date I last played the song. 

edit: I sorta understand Marko to make a "calculated" field, but I have no idea how to do that.
Logged

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: "Fields are formatted by default now"
« Reply #11 on: January 14, 2006, 05:55:11 pm »

OK; I didn't read the thread properly. (I was wrong about the quotes too!)

For the PN skin you have to make a calculated field, which is available throughout MC - when you create an expression in a viewscheme, it's specific to that scheme, and not available in the rest of the Library. The PN plugin only has access to fields.

To create a calculated field, go to 'Options > Library > Add', then enter the name for the field (best make it different from 'Last Played', otherwise you'll create confusion for yourself elsewhere in the program). Then click the radio button beside 'Calculated data', and enter your date format expression there. Click 'OK'; now you have a field that you can enter in PN using the syntax:
<"YourNewCalculatedFieldName">

That should do it! Keep us posted...

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #12 on: January 15, 2006, 12:27:52 am »

Thanks it worked  ;D

If I could get one more thing it would be perfect. Before, the Last Played field stated the elapsed time like 93 days ago.  But now the word "ago" doesn't appear unless I arbitrarily put it in there, which makes songs that I've never played look weird because it'll state 'never played ago'.  Is there a way to fix this? It's not a big thing but I would greatly appreciate the insight.
Logged

EpF

  • Citizen of the Universe
  • *****
  • Posts: 649
Re: "Fields are formatted by default now"
« Reply #13 on: January 15, 2006, 04:11:51 am »

Before, the Last Played field stated the elapsed time like 93 days ago. But now the word "ago" doesn't appear

It did not occur to me that we were effectively looking at a new field.

It looks like that's just the way it is. There have been quite a few requests for J River to look at date formats in expressions recently, so hopefully there will be some changes; however, you should be able to modify your expression to include 'ago' wherever there is a date, and display something else when there isn't, using If(...) - it might be tortuous, though!  ;)

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8941
Re: "Fields are formatted by default now"
« Reply #14 on: January 15, 2006, 06:26:19 am »

this...

if(isempty([number plays]),never played,formatdate([last played,0],elapsed) ago)

should does work.
If you simply edit your existing Lplayed field, you may need to restart MC before the changes are realised.

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: "Fields are formatted by default now"
« Reply #15 on: January 15, 2006, 11:08:53 am »

Thanks Marko!!  ;D
Logged
Pages: [1]   Go Up