mecachisenros / woocommerce_civicrm

GNU Affero General Public License v3.0
14 stars 16 forks source link

Orders tab on contact records show incorrect time #36

Open mjwright opened 3 years ago

mjwright commented 3 years ago

Has anyone else noticed that the time shown for orders on the Woocommerce Orders tab is shown as UTC time and not local time? I was able to fix this by replacing the following line in get_orders(), class-woocommerce-civicrm-orders-contact-tab.php

Replace: $orders[$customer_order->ID]['order_date'] = date_i18n($date_format , strtotime($order->get_date_created()));

With: $orders[$customer_order->ID]['order_date'] = $order->get_date_created()->date_i18n($date_format);