Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

The date field of GET /comments should contain either a 'Z' time offset signature. #1675

Description

@southp

Environment

WordPress: 4.3.1
WP REST API: 2.0-beta 4
Machine: Chassis with VirtualBox 4.3.28 as its VM backend

How To

Using the following snippet:

#!/bin/sh
http POST <url> author_name='Shell' \
    author_email='[email protected]' \
    author_url='http://goog.le' \
    content='wp rest api rocks!' \
    date='2015-10-22T12:00:00Z' \
    post=<pid> \
    parent=0

The date field of the response will be 2015-10-22T12:00:00, so does GET /comments.

According to the ECMAScript 2015 spec:

If the time zone offset is absent, the date-time is interpreted as a local time.

Thus, the returned date string is a local time string instead of the originally-submitted UTC time string for any browser implementing this spec.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions