{"id":13733279,"url":"https://github.com/TappNetwork/filament-timezone-field","last_synced_at":"2025-05-08T09:31:52.578Z","repository":{"id":40438629,"uuid":"489134762","full_name":"TappNetwork/filament-timezone-field","owner":"TappNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-02T20:09:37.000Z","size":439,"stargazers_count":48,"open_issues_count":6,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-07T23:45:01.578Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TappNetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-05T21:47:08.000Z","updated_at":"2025-05-01T11:58:56.000Z","dependencies_parsed_at":"2024-04-17T03:27:42.832Z","dependency_job_id":"f43c5574-84a2-421c-8ad6-c98158032efd","html_url":"https://github.com/TappNetwork/filament-timezone-field","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"bf2e67b5f514826f7044b3361803bd56f979742c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-timezone-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-timezone-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-timezone-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TappNetwork%2Ffilament-timezone-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TappNetwork","download_url":"https://codeload.github.com/TappNetwork/filament-timezone-field/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253036540,"owners_count":21844228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-08-03T03:00:40.458Z","updated_at":"2025-05-08T09:31:52.570Z","avatar_url":"https://github.com/TappNetwork.png","language":"PHP","funding_links":[],"categories":["Fields","Plugins"],"sub_categories":["Administration \u0026 Management"],"readme":"# Filament Timezone Field\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/tapp/filament-timezone-field.svg?style=flat-square)](https://packagist.org/packages/tapp/filament-timezone-field)\n![Code Style Action Status](https://github.com/TappNetwork/filament-timezone-field/actions/workflows/pint.yml/badge.svg)\n[![Total Downloads](https://img.shields.io/packagist/dt/tapp/filament-timezone-field.svg?style=flat-square)](https://packagist.org/packages/tapp/filament-timezone-field)\n\nA timezone select field for Laravel Filament.\n\n## Installation\n\n```bash\ncomposer require tapp/filament-timezone-field:\"^3.0\"\n```\n\n\u003e **Note** \n\u003e For **Filament 2.x** check the **[2.x](https://github.com/TappNetwork/filament-timezone-field/tree/2.x)** branch\n\n## Usage\n\n### Form Field\n\nAdd to your Filament resource:\n\n```php\nuse Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\npublic static function form(Form $form): Form\n{\n    return $form\n        -\u003eschema([\n            // ...\n            TimezoneSelect::make('timezone'),\n            // ...\n        ]);\n}\n```\n\n#### Appareance\n\n![Filament Timezone Field](https://raw.githubusercontent.com/TappNetwork/filament-timezone-field/main/docs/filament-timezone-field.png)\n\n#### Options\n\nTo change the language of displayed timezones, use the `-\u003elanguage()` method passing the ISO 639-1 language code:\n\n```php\n-\u003elanguage('es')\n```\n\nTo use GMT instead of UTC (default is UTC), add the `-\u003etimezoneType('GMT')` method:\n\n```php\nuse Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\npublic static function form(Form $form): Form\n{\n    return $form\n        -\u003eschema([\n            // ...\n            TimezoneSelect::make('timezone')\n                -\u003etimezoneType('GMT'),\n            // ...\n        ]);\n}\n```\n\n##### List timezones by country\n\nTo list only the timezones for a country, you can pass the country code to `-\u003ebyCountry()` method. For example, to list only United States timezones:\n\n```php\nTimezoneSelect::make('timezone')\n    -\u003ebyCountry('US')\n```\n\nYou can also pass an array with more than one country code:\n\n```php\nTimezoneSelect::make('timezone')\n    -\u003ebyCountry(['US', 'AU'])\n```\n\n##### List timezones by region\n\nTo list the timezones for a region use the `-\u003ebyRegion()` method. You can specify a region with a [Region enum value](src/Enums/Region.php):\n\n```php\nuse Tapp\\FilamentTimezoneField\\Enums\\Region;\n\nTimezoneSelect::make('timezone')\n    -\u003ebyRegion(Region::Australia)\n```\n\nor you can use one of the [PHP's DateTimeZone predifined constants](https://www.php.net/manual/en/class.datetimezone.php):\n\n```php\nuse DateTimeZone;\n\nTimezoneSelect::make('timezone')\n    -\u003ebyRegion(DateTimeZone::AUSTRALIA)\n```\n\nIt's also possible to pass an array with more than one region:\n\n```php\nuse Tapp\\FilamentTimezoneField\\Enums\\Region;\n\nTimezoneSelect::make('timezone')\n    -\u003ebyRegion([Region::Australia, Region::America])\n```\n\n\u003e [!TIP]\n\u003e All [Filament select field](https://filamentphp.com/docs/2.x/forms/fields#select) methods are available to use:\n\u003e \n\u003e ```php\n\u003e use Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\u003e\n\u003e public static function form(Form $form): Form\n\u003e {\n\u003e    return $form\n\u003e        -\u003eschema([\n\u003e            // ...\n\u003e            TimezoneSelect::make('timezone')\n\u003e                -\u003esearchable()\n\u003e                -\u003erequired(),\n\u003e            // ...\n\u003e        ]);\n\u003e }\n\u003e ```\n\nOptionally, hide either timezone offsets or timezone names, depending on your use case:\n\n![Filament Timezone Display Options](https://raw.githubusercontent.com/TappNetwork/filament-timezone-field/main/docs/hide-timezone-offset.png)\n\n```php\nuse Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\npublic static function form(Form $form): Form\n{\n    return $form\n        -\u003eschema([\n            // ...\n            TimezoneSelect::make('timezone')\n                -\u003ehideNames(),\n            // ...\n        ]);\n}\n```\n\n```php\nuse Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\npublic static function form(Form $form): Form\n{\n    return $form\n        -\u003eschema([\n            // ...\n            TimezoneSelect::make('timezone')\n                -\u003ehideOffset(),\n            // ...\n        ]);\n}\n```\n\nOptionally, hydrate the field with the timezone from the user's browser. If there is already a value, it will not be overridden.\n\n```php\nuse Tapp\\FilamentTimezoneField\\Forms\\Components\\TimezoneSelect;\n\npublic static function form(Form $form): Form\n{\n    return $form\n        -\u003eschema([\n            // ...\n            TimezoneSelect::make('timezone')\n                -\u003egetTimezoneFromBrowser()\n            // ...\n        ]);\n}\n```\n\n### Table Column\n\n```php\nuse Tapp\\FilamentTimezoneField\\Tables\\Columns\\TimezoneColumn;\n\npublic static function table(Table $table): Table\n{\n    return $table\n        -\u003ecolumns([\n            //...\n            TimezoneColumn::make('timezone')\n                -\u003etimezoneType('GMT')\n                -\u003eformattedOffsetAndTimezone(),\n        ])\n        // ...\n}\n```\n\n#### Options\n\n| Method | Description |\n| --- | --- |\n| -\u003eformattedTimezone()  | Show formatted timezone name |\n| -\u003eformattedOffsetAndTimezone() | Show formatted offset and timezone name |\n| -\u003etimezoneType('GMT') | Use GMT instead of UTC  |\n\n### Table Filter\n\n```php\nuse Tapp\\FilamentTimezoneField\\Tables\\Filters\\TimezoneSelectFilter;\n\npublic static function table(Table $table): Table\n{\n    return $table\n        //...\n        -\u003efilters([\n            TimezoneSelectFilter::make('timezone'),\n            // ...\n        ])\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTappNetwork%2Ffilament-timezone-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTappNetwork%2Ffilament-timezone-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTappNetwork%2Ffilament-timezone-field/lists"}