| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentCart\App\Services; |
| 4 | 4 | |
| 5 | 5 | use FluentCart\Api\StoreSettings; |
| 6 | +use FluentCart\App\Services\DateTime\DateFormatter; | |
| 6 | 7 | use FluentCart\Framework\Support\Arr; |
| 7 | 8 | |
| 8 | 9 | if (!defined('ABSPATH')) { |
| 9 | 10 | exit; |
| @@ -85,16 +86,21 @@ | ||
| 85 | 86 | } |
| 86 | 87 | |
| 87 | 88 | public function getOtherData($key) |
| 88 | 89 | { |
| 90 | + // wp_date(), not current_time(): current_time() is gmdate() underneath, | |
| 91 | + // so it renders the store's format with English month and weekday | |
| 92 | + // names -- '14. October 2026' on a German store, which is the exact | |
| 93 | + // half-translated string DateFormatter exists to remove. wp_date() | |
| 94 | + // with no timestamp is the same instant in the same site timezone, | |
| 95 | + // only localized. The format comes from DateFormatter so these two | |
| 96 | + // shortcodes follow date_time_format_source like every other date. | |
| 89 | 97 | if ($key == 'date') { |
| 90 | - $dateFormat = get_option('date_format'); | |
| 91 | - return current_time($dateFormat); | |
| 98 | + return wp_date(DateFormatter::dateFormat()); | |
| 92 | 99 | } |
| 93 | 100 | |
| 94 | 101 | if ($key == 'time') { |
| 95 | - $dateFormat = get_option('time_format'); | |
| 96 | - return current_time($dateFormat); | |
| 102 | + return wp_date(DateFormatter::timeFormat()); | |
| 97 | 103 | } |
| 98 | 104 | if ($key == 'user_ip') { |
| 99 | 105 | return $this->entry->ip_address; |
| 100 | 106 | } |