tapp/filament-timezone-field
Filament Timezone Field adds a timezone select component to Filament forms. Supports Filament 3/4/5, localized timezone labels, UTC or GMT display, and filtering options by country codes or region for cleaner, relevant timezone lists.
Pros:
Select field methods (e.g., searchable(), required()), enabling customization without reinventing the wheel.DateTimeZone compatibility), mitigating edge cases like DST transitions.Cons:
symfony/intl (v6+), adding ~1MB to deployment size and introducing potential locale-specific performance overhead.America/New_York), compatible with any Laravel-supported database.getTimezoneFromBrowser()) bridges client-side context with server-side storage, but requires JavaScript (no SSR fallback).Asia/Kolkata vs. Asia/Calcutta) may require custom labeling.byCountry()/byRegion() to scope options.getTimezoneFromBrowser() may fail in headless or ad-blocking environments (test thoroughly).byCountry(['US', 'EU']))?getTimezoneFromBrowser())?Europe/Madrid)? Test with language('es').UTC+2) map to IANA timezones (e.g., Europe/Berlin)?Carbon/DateTime for timezone-aware operations.config('app.timezone')) is simpler.UTC offset strings vs. IANA names).// Before: Custom select field
Select::make('timezone')->options([
'UTC' => 'UTC',
'America/New_York' => 'EST/EDT',
]);
// After: Package field
TimezoneSelect::make('timezone')->byCountry('US');
// Example: Convert "UTC+2" to "Europe/Berlin"
$user->update(['timezone' => TimezoneConverter::toIana($user->timezone)]);
spatie/fork or custom logic to map legacy formats.symfony/intl (v6+): Ensure your server has ICU data installed (e.g., apt-get install icu-libs).filament/support: Core Filament package must be installed.getTimezoneFromBrowser() requires JavaScript and a modern browser (test with Intl.DateTimeFormat().resolvedOptions().timeZone).symfony/intl and ICU data.TimezoneSelect::make('timezone')) before advanced features (e.g., byRegion()).symfony/intl may require updates.composer.json to avoid surprises.symfony/intl installation.Intl support exists.wire:log for component errors.php -m | grep intl to verify ICU support.byCountry() with custom labels).formattedOffsetAndTimezone()). Mitigate with:
timezone_column as VARCHAR).timezone_display column).
How can I help you explore Laravel packages today?