Fixed date_created and date_created_gmt for customers v2
This commit is contained in:
parent
7d9babf1c2
commit
0b1c1dd422
|
@ -38,7 +38,7 @@ class WC_REST_Customers_V2_Controller extends WC_REST_Customers_V1_Controller {
|
|||
|
||||
// Format date values.
|
||||
foreach ( $format_date as $key ) {
|
||||
$datetime = $data[ $key ];
|
||||
$datetime = 'date_created' === $key ? get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $data[ $key ]->getTimestamp() ) ) : $data[ $key ];
|
||||
$data[ $key ] = wc_rest_prepare_date_response( $datetime, false );
|
||||
$data[ $key . '_gmt' ] = wc_rest_prepare_date_response( $datetime );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue