[wp-trac] [WordPress Trac] #38883: Shim post_date_gmt for drafts / empty dates in the REST API
WordPress Trac
noreply at wordpress.org
Sun Nov 20 21:28:01 UTC 2016
#38883: Shim post_date_gmt for drafts / empty dates in the REST API
----------------------------------------+------------------------------
Reporter: joehoyle | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: needs-patch has-unit-tests | Focuses:
----------------------------------------+------------------------------
Comment (by joehoyle):
As a means of getting the discussion going, I've added a patch that shims
the `date_gmt` value to the UTC "version" of the `date` field - this means
API clients will always have a UTC date to rely on. Currently, if clients
want to show dates in the timezone of their users, it's virtually not
possible to do that for drafts.
To make it _possible_ we could expose the `gmt_offset` / timezone on the
site's root `/wp-json/` so atleast a client could *technically* reverse
the `date` field into a `date_gmt` value themselves - that's certainly not
a pretty solution though.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38883#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list