Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Browser Timezone

Filament Browser Timezone Laravel Package

webteractive/filament-browser-timezone

View on GitHub
Deep Wiki
Context7

A Filament plugin to detect user's browser timezone and make it available to Tables, Forms, and Infolist via session

Frequently asked questions about Filament Browser Timezone
How do I integrate this package into an existing Filament v3/v4/v5 project?
Install via Composer (`composer require webteractive/filament-browser-timezone`) and it auto-discovers Filament panels. No manual configuration is needed—it hooks into Filament’s render system via `panels::body.start` and stores the timezone in Laravel’s session.
Will this work with Filament v5’s Livewire 4.x updates?
Yes, the package explicitly supports Livewire v3-v4, which covers Filament v5. It uses Livewire’s client-server communication for timezone detection, ensuring compatibility with Filament’s latest architecture.
What happens if a user’s browser doesn’t support the Intl.DateTimeFormat API?
The package includes graceful fallbacks. Unsupported browsers default to the configured fallback timezone (e.g., UTC or server timezone), which you can set via `config(['filament-browser-timezone.fallback' => 'UTC'])` in your `config/filament.php`.
Can I use this for displaying user-generated timestamps in tables/forms without hardcoding timezones?
Absolutely. Use `BrowserTimezone::get()` in `TextColumn::make()` or `DateTimePicker::make()` to dynamically apply the user’s timezone. For example, `TextColumn::make('created_at')->dateTime()->timezone(BrowserTimezone::get())` ensures timestamps render in local time.
Does this package add noticeable performance overhead to Filament panels?
No, the package is optimized for minimal impact. Timezone detection runs on page load via JavaScript, and session storage is skipped if the timezone is already set. Benchmarking shows negligible latency, even in high-traffic panels.
How do I handle cases where the session timezone data might be corrupted or invalid?
The package validates timezones on retrieval. If invalid data is detected (e.g., malformed session), it falls back to the configured default. For extra safety, wrap calls with `BrowserTimezone::has()` to check availability before use.
Is there a way to force all users to see UTC instead of their local timezone?
Yes, disable automatic detection by setting `'auto_detect' => false` in the config and manually set timezones via `BrowserTimezone::set('UTC')`. This bypasses browser detection entirely, useful for internal consistency.
What Laravel versions does this package support, and are there PHP requirements?
The package supports Laravel 10–13 and PHP 8.2+. It aligns with Filament’s version constraints, so no conflicts arise. Laravel 13 requires PHP 8.3, but the package maintains backward compatibility with PHP 8.2 for older Laravel versions.
Can I use this alongside other timezone packages like Carbon or Moment.js?
Yes, the package outputs standard IANA timezone strings (e.g., `America/New_York`), which integrate seamlessly with Carbon, Moment.js, or Laravel’s built-in timezone handling. It doesn’t replace these tools but provides the browser timezone data they need.
What’s the migration path if I’m already using hardcoded timezones or server time in Filament?
Audit your resources/forms for hardcoded timezones (e.g., `->timezone('UTC')`) and replace them with `BrowserTimezone::get()`. For server-side logic, use `BrowserTimezone::get()` as a fallback to ensure consistency. The package’s session-driven approach minimizes breaking changes.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity