Listing by specific date on Detail List Page

6 posts by 3 authors in: Forums > CMS Builder
Last Post: August 5, 2013   (RSS)

To list only today's records you might try this suggestion from Dave Edis:

'where' => "YEAR(date) = YEAR(NOW()) AND DAYOFYEAR(date) = DAYOFYEAR(NOW())",


If that doesn't help, there are some pretty detailed recipes in my CMSB Cookbook http://www.thecmsbcookbook.com that deal with comparing dates, showing dates within a range and other ideas for working with dates.

Hope this helps

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By nmsinc - August 3, 2013

Hi Jerry,

Thanks for the help Jerry, however, I'm coding around the zicky calendar and I have added a reminder posting for each day with listing for the entire daily schedule. What I'm trying to do is take the last date from the list and post it to the URL of a page that can be converted to PDF and printed. I know that the list page for the PDF works as I can do a full list of all reminders so using the date in the URL I thought should produce the correct results - it returns NO RECORDS found.

My full list stamen is:

list($eventsRecords, $eventsMetaData) = getRecords(array(
    'tableName'   => 'events',
    'where'           => whereRecordNumberInUrl(0),
    'loadUploads' => false,
    'allowSearch' => false,
  ));

nmsinc

Hi,

Just an idea...

If you were looking for this weeks event reminders you might be able to define  some variables and then use if statements to separate the results...

$eventdate =    strtotime($record['date']);
$dateplus0 = strtotime(date('Y-m-d', strtotime("+ 0 day")));
$dateplus1 = strtotime(date('Y-m-d', strtotime("+ 1 day")));
$dateplus2 = strtotime(date('Y-m-d', strtotime("+ 2 day")));
etc...

Then compare the variables something like:

if ($dateplus0 == $event date)

show today's events

elseif ($dateplus1 == $event date)

Show tomorrows events

elseif ($dateplus2 == $event date)

Show  events 2 days from now

Etc.

best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By nmsinc - August 3, 2013

Hi Jerry,

Sorry if I have confused you. All I need to do is filter the list results by the field "date". The funny thing is; I cannot filter by any of the fields. Any field filter request I make returns all records!

nmsinc

Hi Jerry and nmsinc,

Did you end up resolving this post? Were you trying to filter items in a section based on date?

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com