Re: [willydoit] Events Diary Creation
Hi willydoit,
Try this:
- Rename your search field 'targetDate'
- Zero pad the month numbers so they are all 2 digits (and Mar is 03)
- Change the values to be like this: 2009-03, use <?php echo date('Y'); ?> to display the current year.
That will give us a valid mysql date we can use for comparison. Then above your code block have this line:
$escapedTargetDate = mysql_real_escape_string( $_REQUEST['targetDate'] );
Then in your list viewer options have this:
'where' => "startdate <= '$escapedTargetDate' AND '$escapedTargetDate' <= removeDate",
That will let you search for a month that is within the range. In general, though, date and calendar systems are _very_ complicated. I've done a few through custom programming and just figuring out how to display things in a way that makes sense is enough of a challenge before you even get to the programming. The issue is all the different combination of dates (some are on certain days only, some are re-occurring, etc).
For simple event lists CMS Builder is great but if you find you want to do something more advanced you're be better off with a pre-made web-calendar system or something custom built.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com