Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #29908, comment 5


Ignore:
Timestamp:
10/13/2014 01:53:29 AM (10 years ago)
Author:
boonebgorges
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29908, comment 5

    initial v1  
    88If I were building this from scratch, I might agree with you. But the rounding-up logic is already in WP_Date_Query, for when an incomplete array value like `array( 'year' => 2013, 'month' => 04 )` is passed. So it makes sense to use it.
    99
    10 The real challenge here is figuring out what date formats to accept. [29908.patch] adds inclusive support for `Y`, `Y-m`, `Y-m-d`, `Y-m-d H:i`, and `Y-m-d H:i:s`, as well as the same formats with `/` instead of `-`. (If there is PHP tool for computing the date format from a string - _without_ rounding it down, like `strtotime()` - I couldn't find it. Obviously they have the internals....) I figure this is better than nothing, and the first three in particular will probably cover many use cases.
     10The real challenge here is figuring out what date formats to accept. [attachment:29908.patch] adds inclusive support for `Y`, `Y-m`, `Y-m-d`, `Y-m-d H:i`, and `Y-m-d H:i:s`, as well as the same formats with `/` instead of `-`. (If there is PHP tool for computing the date format from a string - _without_ rounding it down, like `strtotime()` - I couldn't find it. Obviously they have the internals....) I figure this is better than nothing, and the first three in particular will probably cover many use cases.
    1111
    1212magicroundabout, you want to have a look and see if it's working for you?