[wp-trac] [WordPress Trac] #29908: date_query inclusive logic still not quite right
WordPress Trac
noreply at wordpress.org
Thu Oct 9 16:33:29 UTC 2014
#29908: date_query inclusive logic still not quite right
-----------------------------+-----------------------------
Reporter: magicroundabout | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.0
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
[Please be gentle - I've not contributed much!]
This was sort-of addressed in #26653, but I'm re-raising it because the
inclusive logic still doesn't seem right to me.
I've done:
{{{
date_query => array(
"after" => 2013-04-07,
"before" => 2013-10-13,
"inclusive"=> true,
}
}}}
And this generates:
{{{
AND ( ( post_date >= '2013-04-07 00:00:00'
AND post_date <= '2013-10-13 00:00:00' ) )
}}}
This is NOT inclusive of the before date. It should be:
{{{
AND ( ( post_date >= '2013-04-07 00:00:00'
AND post_date <= '2013-10-13 23:59:59' ) )
}}}
I've not had time to dive into the code and see how this is generated yet.
Might have time to do that later. Will log some more detail then if I
can.
Thanks
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29908>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list