I’m using Ditto to help me with some scheduling app;
How would I limit the Ditto results to todays date? (today being dynamic)
Any help is much appreciated.
I twitch because I care....and drink too much coffee.
Thanks for the fast reply. I’m not sure though how to take that information and translate it to today’s date. I’m a bit of a noob here so bare with me.
To summaraize I want to filter my Ditto results for pages that have a TV (CalStart & CalEnd) equal to today.
My thinking is that I have to create a snippet to find todays date, format it for UNIXTIME and then throw that into a Ditto filter?
If the value of the TV is something like:
20-05-2009 14:15:00
Do I need to parse that to find out if it’s todays date? Or in other words do I need to worry about the time assocaited? Ideally I’d want the ditto call to sort based on the full date/time TV. Is this possible? Am I on the right track? Once I get back to the office I’ll start messing more with the info in the last post, and again thanks for the speedy reply.
I twitch because I care....and drink too much coffee.
[[ ... &dateSource=`pub_date` &extenders=`dateFilter` &dateFilterSource=`params` &dateFilterDefault=`3` &month=`[!Month!]` &day=`[!Day!]` ...]]
Month
<?php
// get the current time and apply the offset
$timestamp = time() + date_default_timezone_set('America/Los_Angeles');
// Set the current month
$month = date('m',$timestamp);
print $month;
?>
Day
<?php
// get the current time and apply the offset
$timestamp = time() + date_default_timezone_set('America/Los_Angeles');
// Set the current day
$day = date('d',$timestamp);
print $day;
?>