This commit is contained in:
Prospress Inc
2018-09-28 16:11:56 +02:00
committed by Remco Tolsma
parent a3be3724dc
commit ce24e61a4c
44 changed files with 526 additions and 357 deletions

View File

@@ -95,6 +95,10 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_V1_Controller {
$response->data[ $date_type . '_date' ] = ( ! empty( $date ) ) ? wc_rest_prepare_date_response( $date ) : '';
}
// v1 API includes some date types in site time, include those dates in UTC as well.
$response->data['date_completed_gmt'] = wc_rest_prepare_date_response( $subscription->get_date_completed() );
$response->data['date_paid_gmt'] = wc_rest_prepare_date_response( $subscription->get_date_paid() );
}
return $response;
@@ -464,6 +468,18 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_V1_Controller {
'context' => array( 'view' ),
'readonly' => true,
),
'date_completed_gmt' => array(
'description' => __( "The date the subscription's latest order was completed, in GMT.", 'woocommerce-subscriptions' ),
'type' => 'date-time',
'context' => array( 'view' ),
'readonly' => true,
),
'date_paid_gmt' => array(
'description' => __( "The date the subscription's latest order was paid, in GMT.", 'woocommerce-subscriptions' ),
'type' => 'date-time',
'context' => array( 'view' ),
'readonly' => true,
),
);
$schema['properties'] += $subscriptions_schema;