[wp-trac] [WordPress Trac] #39954: REST API: Improve date updates if both `date` and `date_gmt` are set

WordPress Trac noreply at wordpress.org
Mon Feb 27 00:27:09 UTC 2017


#39954: REST API: Improve date updates if both `date` and `date_gmt` are set
-------------------------+------------------------------
 Reporter:  jnylen0      |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  REST API     |     Version:  4.7
 Severity:  minor        |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by rmccue):

 Replying to [ticket:39954 jnylen0]:
 > If both `date` and `date_gmt` are specified, '''and''' the two values do
 not match according to the site's current timezone offset, there are a
 couple of options for improving the behavior:
 >
 > - Update the date fields exactly as requested, even though they will not
 match the site's current timezone offset.
 > - Return an error.

 One other condition should be valid: if they match the existing values,
 then do not alter it, even if the timezone has changed since. (Use case:
 sending exact response data back to server.)

 I think the best approach is: if the dates do not match the existing
 values, and the date/date_gmt are not exactly gmt_offset apart, return a
 400 Bad Request error indicating invalid dates.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39954#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list