{"id":18000930,"url":"https://github.com/cgsmith/yii2-flatpickr-widget","last_synced_at":"2025-10-05T00:09:16.299Z","repository":{"id":64284110,"uuid":"574733824","full_name":"cgsmith/yii2-flatpickr-widget","owner":"cgsmith","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-25T08:18:18.000Z","size":15,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-04T06:57:32.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cgsmith.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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-12-06T00:37:56.000Z","updated_at":"2024-09-25T08:16:05.000Z","dependencies_parsed_at":"2024-11-23T04:03:28.843Z","dependency_job_id":null,"html_url":"https://github.com/cgsmith/yii2-flatpickr-widget","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"8adae0ab8b43a37cac9f46e5e1f9230f6247a2ec"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cgsmith/yii2-flatpickr-widget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fyii2-flatpickr-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fyii2-flatpickr-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fyii2-flatpickr-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fyii2-flatpickr-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgsmith","download_url":"https://codeload.github.com/cgsmith/yii2-flatpickr-widget/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fyii2-flatpickr-widget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391226,"owners_count":25978950,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-29T23:15:28.056Z","updated_at":"2025-10-05T00:09:16.255Z","avatar_url":"https://github.com/cgsmith.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flatpickr JS Widget for Yii2\n====================================\n\n[![Latest Stable Version](https://poser.pugx.org/cgsmith/yii2-flatpickr-widget/v)](https://packagist.org/packages/cgsmith/yii2-flatpickr-widget) \n[![Total Downloads](https://poser.pugx.org/cgsmith/yii2-flatpickr-widget/downloads)](https://packagist.org/packages/cgsmith/yii2-flatpickr-widget) \n[![Latest Unstable Version](https://poser.pugx.org/cgsmith/yii2-flatpickr-widget/v/unstable)](https://packagist.org/packages/cgsmith/yii2-flatpickr-widget) \n[![License](https://poser.pugx.org/cgsmith/yii2-flatpickr-widget/license)](https://packagist.org/packages/cgsmith/yii2-flatpickr-widget) \n\n\nRenders a [flatpickr Datepicker plugin](https://flatpickr.js.org/).\n\nInstallation\n------------\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```bash\n$ composer require cgsmith/yii2-flatpickr-widget:~1.1\n```\nor add\n\n```json\n\"cgsmith/yii2-flatpickr-widget\": \"~1.1\"\n```\n\nto the require section of your application's `composer.json` file.\n\nUsage\n-----\nThe widget renders the flatpickr onto your form.\n\n***Example of use with a form***  \nUse the widget by setting up its `model` and `attribute`.\n\n```php\n\u003c?php\nuse cgsmith\\flatpickr\\FlatpickrWidget;\n\n// as a widget\n?\u003e\n\n\u003c?= FlatpickrWidget::widget([\n    'model' =\u003e $model,\n    'attribute' =\u003e 'date',\n]);?\u003e\n\n\n\u003c?php \n// additional config options for flatpickr\n\necho $form-\u003efield($model, 'date')-\u003ewidget(\n    FlatpickrWidget::widget([\n    'model' =\u003e $model,\n    'attribute' =\u003e 'date',\n    'flatpickrConfig' =\u003e [ // This is passed as a JSON object to flatpickr\n        'enableTime' =\u003e false,\n        'dateFormat' =\u003e 'F j, Y H:i',\n        'altInput' =\u003e true,\n        'altFormat' =\u003e 'F j, Y',\n        'locale' =\u003e 'ru', // optional\n    ]\n]);\n?\u003e\n```  \n\n#### Example\n\n\u003e It's not a demo without a GIF\n\n![](https://media.giphy.com/media/0FqQ0sWALaeWSSdxyw/giphy.gif)\n\n\n\n***Example of use on Gridview***\nYou may need to adjust the filter to work with your form or search model but this is how it is working with a default\nYii installation.\n\n```php\n\u003c?php\n    echo GridView::widget([\n        'dataProvider' =\u003e $dataProvider,\n        'filterModel' =\u003e $searchModel,\n        'columns' =\u003e [\n            ['class' =\u003e 'yii\\grid\\SerialColumn'],\n            [\n                'attribute' =\u003e 'created_at',\n                'label' =\u003e 'Created At',\n                'format' =\u003e 'datetime',\n                'value' =\u003e 'created_at',\n                'filter' =\u003e \\cgsmith\\flatpickr\\FlatpickrWidget::widget(\n                    [\n                        'model' =\u003e $searchModel,\n                        'attribute' =\u003e 'created_at',\n                        'flatpickrConfig' =\u003e [\n                                'enableTime' =\u003e false,\n                                'dateFormat' =\u003e 'U',\n                                'altInput' =\u003e true,\n                                'altFormat' =\u003e 'F j, Y',\n                        ],\n                    ]\n                )\n            ],\n            'updated_at:datetime',\n            // other columns and settings for gridview\n        ],\n    ]);\n```\n\nResources Information\n-------------------\nPlease, check the [flatpicker site](https://flatpickr.js.org/options/) documentation for further information about its configuration options.\n\nContributing\n------------\n\nContributions are welcome! \n\nCredits\n-------\n\n- [Chris Smith](https://github.com/cgsmith)\n- [All Contributors](../../contributors)\n\nLicense\n-------\n\nThe BSD License (BSD). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fyii2-flatpickr-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgsmith%2Fyii2-flatpickr-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fyii2-flatpickr-widget/lists"}