#38986 closed defect (bug) (duplicate)
WP-API - List posts: `before` and `after` doesn't seem to support true ISO 8601
Reported by: | LaustDeleuran | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6.1 |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
Description
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?
Change History (5)
This ticket was mentioned in Slack in #core-restapi by chopinbach. View the logs.
8 years ago
#3
in reply to:
↑ description
@
8 years ago
Hi @LaustDeleuran - I agree that #38641 is the right place to track this, but one angle that is not covered there is that our documentation implies full ISO8601 compliance.
Would you mind leaving a comment over there to that effect? This will help us prioritize this issue as it's currently labeled as an enhancement without any mention of the incorrect docs.
Duplicate of #38641.
Looks like this is a duplicate of https://core.trac.wordpress.org/ticket/38641