| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | use FluentCart\Api\StoreSettings; |
| 6 | 6 | use FluentCart\App\App; |
| 7 | 7 | use FluentCart\App\Helpers\Helper; |
| 8 | 8 | use FluentCart\App\Helpers\Status; |
| 9 | +use FluentCart\App\Services\DateTime\DateFormatter; | |
| 9 | 10 | use FluentCart\App\Services\Report\DefaultReportService; |
| 10 | 11 | use FluentCart\App\Services\ShortCodeParser\ShortcodeTemplateBuilder; |
| 11 | 12 | use FluentCart\Framework\Support\Arr; |
| 12 | 13 | |
| @@ -571,20 +572,26 @@ | ||
| 571 | 572 | { |
| 572 | 573 | $startTs = strtotime($start); |
| 573 | 574 | $endTs = strtotime($end); |
| 574 | 575 | |
| 576 | + // date_i18n (not DateFormatter::format) because windowFor() hands us bare | |
| 577 | + // LOCAL wall-clock strings, not GMT -- converting them would shift the label. | |
| 578 | + // Only the pattern comes from the store's settings. | |
| 575 | 579 | if ($frequency === 'monthly') { |
| 576 | - return date_i18n('F Y', $startTs); | |
| 580 | + // A month-and-year label has no WordPress setting of its own, so it is | |
| 581 | + // derived from the store's date format -- a year-first locale keeps its | |
| 582 | + // own field order instead of the English 'month year'. | |
| 583 | + return date_i18n(DateFormatter::monthYearFormat(), $startTs); | |
| 577 | 584 | } |
| 578 | 585 | if ($frequency === 'weekly') { |
| 579 | - /* translators: %1$s: start date (e.g. May 19), %2$s: end date (e.g. May 25, 2026) */ | |
| 586 | + /* translators: %1$s: start date, %2$s: end date */ | |
| 580 | 587 | return sprintf( |
| 581 | 588 | __('%1$s – %2$s', 'fluent-cart'), |
| 582 | - date_i18n('M j', $startTs), | |
| 583 | - date_i18n('M j, Y', $endTs) | |
| 589 | + date_i18n(DateFormatter::dateFormat(), $startTs), | |
| 590 | + date_i18n(DateFormatter::dateFormat(), $endTs) | |
| 584 | 591 | ); |
| 585 | 592 | } |
| 586 | - return date_i18n('F j, Y', $startTs); | |
| 593 | + return date_i18n(DateFormatter::dateFormat(), $startTs); | |
| 587 | 594 | } |
| 588 | 595 | |
| 589 | 596 | private static function storeName(): string |
| 590 | 597 | { |