diff --git a/src/components/DateField.tsx b/src/components/DateField.tsx index d634c2d..585560f 100644 --- a/src/components/DateField.tsx +++ b/src/components/DateField.tsx @@ -51,10 +51,12 @@ export function DateField({ value, onChange, placeholder, min, max, className }: const selected = parseISO(value); const locale = LOCALES[i18n.language as keyof typeof LOCALES] ?? enUS; + // Numeric format keeps a constant button width across dates and locales + // (a "short" month name varies in length and makes the trigger jitter). const display = selected ? selected.toLocaleDateString(i18n.language, { day: '2-digit', - month: 'short', + month: '2-digit', year: 'numeric', }) : ''; @@ -72,18 +74,21 @@ export function DateField({ value, onChange, placeholder, min, max, className }: type="button" className={ className ?? - 'flex items-center gap-2 rounded-lg border border-dark-600 bg-dark-800 px-3 py-1.5 text-sm text-dark-200 transition-colors hover:border-dark-500' + 'flex min-w-[8rem] items-center justify-start gap-2 whitespace-nowrap rounded-lg border border-dark-600 bg-dark-800 px-3 py-1.5 text-sm text-dark-200 transition-colors hover:border-dark-500' } > - {display || placeholder} + + {display || placeholder} + { if (d) { diff --git a/src/components/admin/trafficUsage/filters/PeriodSelector.tsx b/src/components/admin/trafficUsage/filters/PeriodSelector.tsx index 9d020fe..52d5973 100644 --- a/src/components/admin/trafficUsage/filters/PeriodSelector.tsx +++ b/src/components/admin/trafficUsage/filters/PeriodSelector.tsx @@ -42,8 +42,8 @@ export function PeriodSelector({ if (dateMode) { return ( -
- +
+ {t('admin.trafficUsage.dateFrom')} {showCustom && ( -
+
handleDateChange('startDate', v)}