[wp-trac] [WordPress Trac] #38342: Quick Draft: Leverage REST API endpoints
WordPress Trac
noreply at wordpress.org
Thu Oct 27 16:39:18 UTC 2016
#38342: Quick Draft: Leverage REST API endpoints
----------------------------------+-------------------------
Reporter: adamsilverstein | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.7
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: needs-patch REST-API | Focuses: javascript
----------------------------------+-------------------------
Comment (by aduth):
Latest patch resolves outstanding IE8 issues, particularly around parsing
dates.
Implementing these changes highlighted another recurring pain encountered
throughout the process, which is that the `_gmt` date fields from the REST
API are not reliable. This issue is not specific to the REST API, as the
fields themselves are only set to the database for a post in particular
circumstances (ticket:5698#comment:14). If a post is created via the REST
API without a date explicitly set, both `date_gmt` and `modified_gmt` will
be null (`0000-00-00 00:00:00` in the database). This inconsistency forces
us to use `date` instead, which is offset by the site's timezone setting.
Working with dates -- particularly those with timezone offsets -- in
JavaScript, is very difficult and error-prone. A library like
[http://momentjs.com/ Moment.js] is almost essential if this is to become
more common. Otherwise, it would be nice if we could be guaranteed that
the REST API would return valid `_gmt` dates in all cases.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38342#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list