Fix product reviews schema date fields to use new (WP 5.5) `date-time` format (https://github.com/woocommerce/woocommerce-blocks/pull/3109)

* update dates in ProductReviewSchema to 5.5 date-time format:
- https://developer.wordpress.org/rest-api/extending-the-rest-api/schema/#format

* fix formatted date schema - is human readable, not 'date-time'
This commit is contained in:
Rua Haszard 2020-09-04 08:23:10 +12:00 committed by GitHub
parent dfd57b0ee8
commit 2edbd03080
1 changed files with 4 additions and 2 deletions

View File

@ -51,7 +51,8 @@ class ProductReviewSchema extends AbstractSchema {
],
'date_created' => [
'description' => __( "The date the review was created, in the site's timezone.", 'woo-gutenberg-products-block' ),
'type' => 'date-time',
'type' => 'string',
'format' => 'date-time',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],
@ -63,7 +64,8 @@ class ProductReviewSchema extends AbstractSchema {
],
'date_created_gmt' => [
'description' => __( 'The date the review was created, as GMT.', 'woo-gutenberg-products-block' ),
'type' => 'date-time',
'type' => 'string',
'format' => 'date-time',
'context' => [ 'view', 'edit' ],
'readonly' => true,
],