[wp-trac] [WordPress Trac] #29908: date_query inclusive logic still not quite right

WordPress Trac noreply at wordpress.org
Mon Oct 13 12:56:12 UTC 2014


#29908: date_query inclusive logic still not quite right
-------------------------------------+---------------------------
 Reporter:  magicroundabout          |       Owner:  boonebgorges
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  4.1
Component:  Query                    |     Version:  4.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------

Comment (by boonebgorges):

 Replying to [comment:6 magicroundabout]:
 > Why don't we `date_parse()`?

 Yeah, I tried that too :) `date_parse()` does some rounding down.
 `date_parse( '2014-05' )` returns `day=1`. So there's no way to know, just
 by looking at the results of `date_parse()`, whether the intended value
 was '2014-05-01' or just '2014-05'. It would be possible to use
 `date_parse()` for some formats (it's reliable for Y-m-d, for example),
 but relying on this somewhat odd behavior for certain cases seemed odd.

 >  Is there some info somewhere on the best way to create and test out
 patches? Would love to contribute (finally!).

 Absolutely - we'd love to have your contributions. Check out the
 Contributor Handbook: https://make.wordpress.org/core/handbook/the-
 wordpress-codebase/ You'll see links along the left-hand menu for using
 Trac and SVN for generating and applying patches.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29908#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list