{"id":15089254,"url":"https://github.com/trntv/yii2-datetime-widget","last_synced_at":"2025-10-08T11:10:44.159Z","repository":{"id":57072904,"uuid":"42143958","full_name":"trntv/yii2-datetime-widget","owner":"trntv","description":"Yii2 Date/Time Widget","archived":false,"fork":false,"pushed_at":"2018-11-23T12:02:14.000Z","size":14,"stargazers_count":8,"open_issues_count":7,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-06T16:38:46.094Z","etag":null,"topics":[],"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/trntv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-08T23:13:31.000Z","updated_at":"2022-03-14T07:03:31.000Z","dependencies_parsed_at":"2022-08-24T10:51:22.019Z","dependency_job_id":null,"html_url":"https://github.com/trntv/yii2-datetime-widget","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/trntv/yii2-datetime-widget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fyii2-datetime-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fyii2-datetime-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fyii2-datetime-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fyii2-datetime-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trntv","download_url":"https://codeload.github.com/trntv/yii2-datetime-widget/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trntv%2Fyii2-datetime-widget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931654,"owners_count":26070789,"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-08T02:00:06.501Z","response_time":56,"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-09-25T08:41:51.874Z","updated_at":"2025-10-08T11:10:44.133Z","avatar_url":"https://github.com/trntv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yii2 Date/Time Picker Widget\nDate/Time Picker widget for Yii2 framework\nBased on [Eonasdan's Bootstrap 3 Date/Time Picker](https://github.com/Eonasdan/bootstrap-datetimepicker)\n![DateTimePicker](http://i.imgur.com/nfnvh5g.png)\n\nDemo\n----\nSince this is a part of [yii2-starter-kit](https://github.com/trntv/yii2-starter-kit) it's demo can be found in starter\nkit demo [here](http://backend.yii2-starter-kit.terentev.net/article/create).\n\n```\nLogin: webmaster\nPassword: webmaster\n```\n\nBefore you start\n----------------\nMake sure you have [fxp/composer-asset-plugin](https://github.com/francoispluchino/composer-asset-plugin) installed:\n```\ncomposer global require fxp/composer-asset-plugin\n```\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require trntv/yii2-datetime-widget\n```\n\nor add\n\n```\n\"trntv/yii2-datetime-widget\": \"*\"\n```\n\nto the require section of your `composer.json` file.\n\n\n## Usage\n\nOnce the extension is installed, simply use it in your code by  :\n\n```php\n\u003c?php echo $form-\u003efield($model, 'attribute')-\u003ewidget(\n        'trntv\\yii\\datetime\\DateTimeWidget',\n        [ ... options ... ]\n    ); \n?\u003e\n```\n\n## Options\n``phpDatetimeFormat`` - PHP ICU datetime format (Default: ``dd.MM.yyyy, HH:mm``)\n\n``momentDatetimeFormat`` - Moment JS datetime format (Default: ``DD.MM.YYYY, HH:mm``)\n\n``showAddon`` - show or hide input-addon (Default: ``true``)\n\n``addonContent`` - addon content\n\n``phpMomentMapping`` - formats map (Default: ``true``)\n\n``containerOptions`` - widget container optionsgit\n\n``clientOptions`` - [full list of available options](http://eonasdan.github.io/bootstrap-datetimepicker/Options/)\n\n*** Note:\nto enable widget show on textbox focus when used in a button group, use ``allowInputToggle`` option:\n```php\n...\n'clientOptions' =\u003e [\n    'allowInputToggle' =\u003e true\n]\n...\n```\n\n## Examples\nActiveField input widget:\n```php\n\u003c?php echo $form-\u003efield($model, 'datetime')-\u003ewidget(\n    'trntv\\yii\\datetime\\DateTimeWidget',\n    [\n        'phpDatetimeFormat' =\u003e 'yyyy-MM-dd\\'T\\'HH:mm:ssZZZZZ',\n        'clientOptions' =\u003e [\n            'minDate' =\u003e new \\yii\\web\\JsExpression('new Date(\"2015-01-01\")'),\n            'allowInputToggle' =\u003e false,\n            'sideBySide' =\u003e true,\n            'locale' =\u003e 'zh-cn',\n            'widgetPositioning' =\u003e [\n               'horizontal' =\u003e 'auto',\n               'vertical' =\u003e 'auto'\n            ]\n        ]\n    ]\n]); ?\u003e\n```\nStandalone widget for date only:\n```php\n\u003c?php echo trntv\\yii\\datetime\\DateTimeWidget::widget([\n    'phpDatetimeFormat' =\u003e 'yyyy-MM-dd',\n]) ; ?\u003e\n```\nAdd custom JS events:\n```php\n\u003c?php echo trntv\\yii\\datetime\\DateTimeWidget::widget([\n    'clientEvents' =\u003e [\n        'dp.change' =\u003e 'function(e){\n            console.log('dp.change');\n        }',\n    ],\n]) ; ?\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrntv%2Fyii2-datetime-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrntv%2Fyii2-datetime-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrntv%2Fyii2-datetime-widget/lists"}