Jump to content

Recommended Posts

Posted

Hello,

I've a problem with date filtering:

this query works: 

$today = date("Y-m-d", strtotime('today'));
$pages->find("template=page, sort=datetime, datetime>=$today");

but this not:

$today = date("Y-m-d", strtotime('tomorrow'));
$pages->find("template=page, sort=datetime, datetime<=$tomorrow");

why?

Thank you!!

Posted

inside a selector you have to use a timestamp ? 

Just use strtotime without date(), i think it should work ? 

<?php
$today = strtotime('tomorrow');
$pages->find("template=page, sort=datetime, datetime<=$tomorrow");

 

Posted

Thank you zoeck,

never works, it seems a problem related to the datetime field.

Filter the pages through this field doesn't works.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...