fix(loyalty): sweep remaining hardcoded 'en-US' in persona JS files
Follow-up to06e59f73which swept non-loyalty modules. The earlier loyalty fix (dd1f9af8) only touched the shared/ factories; persona- specific JS files in loyalty's admin/, merchant/, store/, and storefront/ dirs were missed and still hardcoded 'en-US'. 13 occurrences across 8 files now use I18n.locale: - admin: loyalty-analytics.js, loyalty-merchant-detail.js, loyalty-programs.js - merchant: loyalty-analytics.js - store: loyalty-analytics.js, loyalty-terminal.js - storefront: loyalty-dashboard.js, loyalty-history.js After this commit grep -rn "'en-US'" --include=*.js across the whole repo returns nothing. Clearing the deck so the JS-016 rule can ship at error severity in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -325,7 +325,7 @@ function adminLoyaltyPrograms() {
|
||||
if (!dateString) return 'N/A';
|
||||
try {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString('en-US', {
|
||||
return date.toLocaleDateString(I18n.locale, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric'
|
||||
@@ -339,7 +339,7 @@ function adminLoyaltyPrograms() {
|
||||
// Format number with thousands separator
|
||||
formatNumber(num) {
|
||||
if (num === null || num === undefined) return '0';
|
||||
return new Intl.NumberFormat('en-US').format(num);
|
||||
return new Intl.NumberFormat(I18n.locale).format(num);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user