[wp-trac] [WordPress Trac] #38986: WP-API - List posts: `before` and `after` doesn't seem to support true ISO 8601

WordPress Trac noreply at wordpress.org
Tue Nov 29 23:02:13 UTC 2016


#38986: WP-API - List posts: `before` and `after` doesn't seem to support true ISO
8601
---------------------------+-----------------------------
 Reporter:  LaustDeleuran  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  REST API       |    Version:  4.6.1
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Originally posted on WP-API's GitHub - https://github.com/WP-API/WP-
 API/issues/2933. Reposting here as [requested by Edwin
 Cromley](https://github.com/BE-Webdesign).

 ----

 Opening this endpoint:

 http://demo.wp-api.org/wp-json/wp/v2/posts?before=2016-11-29

 Tells me that `The date you provided is invalid.`. However, I _am_
 providing a [ISO 8601 compliant](https://en.wikipedia.org/wiki/ISO_8601)
 date, as [according to](https://cl.ly/3p2G3D3f2e1T) the
 [documentation](http://v2.wp-api.org/reference/posts/).

 It looks like providing a full date (with time), makes the endpoint work
 as expected:

 http://demo.wp-api.org/wp-json/wp/v2/posts?before=2016-11-29T00:00:00Z

 Maybe the documentation needs to be updated to reflect that?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38986>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list