filter by date

  • I try to filter by date, so that all future dates would be shown. I tried a couple of solutions but it always shows all my entries.
    my code part of the page: eventtest.php - (I am not using the events app)

    and in the template eventtest.html I'm using this simplified Code:


    I would be glad about any suggestions because I am really stuck.

  • T tried a version without the blocks and I got still the same issue.
    my php:

    and here is my template (eventtest.html):

  • You don't need to have the filtering logic in PHP and the template. That is, you don't need the conditional tag perch:if if you are filtering with perch_content_custom().


    Also, your $today variable shouldn't have quotes around the date() function. It is also not in the correct format. Try:


    PHP
    1. $today = date('Y-m-d');
  • This works fine, but in the moment I change the date to the following:

    and in the template to:

    Code
    1. <perch:content type="date" id="date" label="Datum" time="local" format="d.m.Y, H:i" label="Event date" order="1">

    I also changed the config.php to:

    Code
    1. define('PERCH_TZ', 'Europe/Vienna'); setlocale(LC_ALL, 'de_AT.UTF-8');

    unfortunally it doesn't work. It displays all entries again.