INTERACT FORUM

Please login or register.

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

Author Topic: [SOLVED] Expression to find all programs for *present date*  (Read 1547 times)

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598

While this question is specifically related to the TV guide function, it isn't confined to that, thus I'm placing the thread here...

Is there a search string I can use to create a smartlist (or Theater View Scheme) that will find me all TV shows for *the present date* that start between x and y times?

I say *present date* because I want it to be dynamic i.e each day I want it to show the prgrams between 6 - 10pm for that day.  
I have the date field populated and have created a Start Time field, but how to get it to find *the present day's* shows?

Then also, how to extrapolate that into show data for next 7 days, so between *present date* and *present date + 6 days*

Any help would be great.


Solution:

The rule I used to find all of today's programs is:

[=isequal([Date Recorded],formatdate(now(),d//MM//yyyy),8)]=1

courtesy in part to the thread at

http://yabb.jriver.com/interact/index.php?topic=56487.0

And to find those starting between time A and time B is:

[=IsRange(math(math(mid([date recorded],11,2)*3600)+math(right([date recorded],2)*60)),64800-77400)]=1

where the time range (18:00 - 21:30) is reflected in seconds i.e 18*3600=64800.

Note: Your system needs to display time in HH:mm format for this to work.

Thanks to @Lasse_Lus for this part.

Lasse_Lus

  • Citizen of the Universe
  • *****
  • Posts: 999
Re: Expression to find all programs for *present date*
« Reply #1 on: July 06, 2011, 06:50:21 am »

Logged
MT5FR

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: Expression to find all programs for *present date*
« Reply #2 on: July 06, 2011, 07:05:38 am »

Thanks Lasse_Lus,

I found it about 2 minutes before you posted  :)

Will post the result when I have it.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8973
Re: Expression to find all programs for *present date*
« Reply #3 on: July 06, 2011, 07:24:56 am »

:)

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: Expression to find all programs for *present date*
« Reply #4 on: July 06, 2011, 08:42:50 pm »

Hi Guys,

I got the Show Date part of it working great, now I'm trying to get the "Prime Time" part of it happening.

I'm testing it on another smartlist (before even attempting to combine it  ;D)

I have the search expression

[=isrange([Date Recorded],18:00-21:30,8)]=1

but it's not working. It's showing ALL items in the list, as if it's not recognising the range.

I can do

[=isequal([Date Recorded],18:00,8)]=1

and it shows all items containing that time, just the range search doesn't seem to be working...

Any help is appreciated.

Justin.

Lasse_Lus

  • Citizen of the Universe
  • *****
  • Posts: 999
Re: Expression to find all programs for *present date*
« Reply #5 on: July 07, 2011, 02:51:15 am »

what if you convert to time to seconds ?

like

[=IsRange(math(math(mid([date recorded],11,2)*3600)+math(right([date recorded],2)*60)),64800-77400)]=1

where every hour is 3600 seconds, so 18:00 is 64800 seconds and 77400 = 21:30
Logged
MT5FR

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: Expression to find all programs for *present date*
« Reply #6 on: July 07, 2011, 02:56:39 am »

I could reach through the interweb and kiss you!

You're a legend - thanks Mate!
Pages: [1]   Go Up