Just want to start off by saying a big thanks to all of the developers around here and I apologize in advance if this has been gone over before (I’ve been trying all day to figure this out and I am way new...)
Essentially, what I am trying to do is a weekly event calendar, that uses ditto to display items as a list.
Each event is set up using the un-publish date ($sortBy=`unpub_date` as the date of the event, so it will be removed once the event has passed. I figured this would be easier than adding a tv for an event date which seemed a bit redundant to me.
For my event listing page, I would like to sort the listings on a daily basis going out one week, starting from today’s date.
I have been able to get the events displayed by using the @eval and strtotime....
This is the ditto call I use...
<h2>today</h2>
[!Ditto? &parents=`53,54,49,52,50,53,55` &noResults=`no events scheduled` &display=`all` &sortDir=`ASC` &sortBy=`unpub_date` &dateSource=`unpub_date` &dateFormat=`%D` &tpl=`eventEntry` &filter=`unpub_date,@EVAL return strtotime("11:59 pm");,4`!]
<h2>today +1</h2>
[!Ditto? &parents=`53,54,49,52,50,53,55` &noResults=`no events scheduled` &display=`all` &sortDir=`ASC` &sortBy=`unpub_date` &dateSource=`unpub_date` &dateFormat=`%D` &tpl=`eventEntry` &filter=`unpub_date,@EVAL return strtotime("11:59 pm +1 day");,4`!]
<h2>today +2</h2>
[!Ditto? &parents=`53,54,49,52,50,53,55` &noResults=`no events scheduled` &display=`all` &sortDir=`ASC` &sortBy=`unpub_date` &dateSource=`unpub_date` &dateFormat=`%D` &tpl=`eventEntry` &filter=`unpub_date,@EVAL return strtotime("11:59 pm +2 day");,4`!]
and this is the result:
http://beta.akronicity.com/events/this-week
It seems a bit ungainly but, like I said, I’m new and us noobs tend to code like three year-olds talk. WHich brings me to my question:
Is there a way to filter using "and" versus or? Such as:
"Ditto, will you please get me the events for tomorrow, but don’t include today’s events?"
and "Ditto, will you please get me the events for the day after tomorrow, but don’t include today or tomorrows events?"
and so on for the rest of the week. I am trying to wrap my head around it but I can’t for the life of me figure out a clear and logical way to do this...
thanks in advance for any light you can shed on this -
P
p.s : I was thinking this might be a little more clear:
today should exclude anything > 11:59pm today
tommorow should exclude anything < 11:59pm today and > 11:59 tomorrow
day after tomorrow should exclude anything < 11:59 tomorrow and >11:59 day after tomorrow
and so on...I dunno maybe the logic is a bit broken...