| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | use FluentCart\Api\StoreSettings; |
| 9 | 9 | use FluentCart\App\Helpers\AddressHelper; |
| 10 | 10 | use FluentCart\App\Modules\Tax\TaxModule; |
| 11 | 11 | use FluentCart\App\Services\DateTime\DateTime; |
| 12 | +use FluentCart\App\Services\DateTime\DateFormatter; | |
| 12 | 13 | |
| 13 | 14 | class ReceiptRenderer |
| 14 | 15 | { |
| 15 | 16 | protected $config = null; |
| @@ -242,12 +243,14 @@ | ||
| 242 | 243 | <?php echo esc_html__('Order At', 'fluent-cart'); ?> |
| 243 | 244 | </p> |
| 244 | 245 | <p style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;"> |
| 245 | 246 | <?php |
| 246 | - $date = wp_date( | |
| 247 | - get_option('date_format'), | |
| 247 | + // Through DateFormatter so the store's format and timezone settings | |
| 248 | + // reach this too; orderTz is only consulted on the Browser source. | |
| 249 | + $date = DateFormatter::format( | |
| 248 | 250 | DateTime::anyTimeToGmt($order->created_at)->getTimestamp(), |
| 249 | - new \DateTimeZone($this->orderTz) | |
| 251 | + false, | |
| 252 | + $this->orderTz | |
| 250 | 253 | ); |
| 251 | 254 | echo esc_html(Helper::translateNumber($date)); |
| 252 | 255 | ?> |
| 253 | 256 | </p> |
| @@ -809,12 +812,14 @@ | ||
| 809 | 812 | <?php echo esc_html($transaction->getPaymentMethodText()); ?> |
| 810 | 813 | </td> |
| 811 | 814 | <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: center;"> |
| 812 | 815 | <?php |
| 813 | - $date = wp_date( | |
| 814 | - get_option('date_format'), | |
| 816 | + // Same route as the Order At header above, or | |
| 817 | + // one receipt renders two different formats. | |
| 818 | + $date = DateFormatter::format( | |
| 815 | 819 | DateTime::anyTimeToGmt($transaction->created_at)->getTimestamp(), |
| 816 | - new \DateTimeZone($this->orderTz) | |
| 820 | + false, | |
| 821 | + $this->orderTz | |
| 817 | 822 | ); |
| 818 | 823 | echo esc_html(Helper::translateNumber($date)); |
| 819 | 824 | ?> |
| 820 | 825 | </td> |