{"id":14966550,"url":"https://github.com/yii2-extensions/datetime-picker","last_synced_at":"2025-10-18T02:02:25.854Z","repository":{"id":209078315,"uuid":"722487175","full_name":"yii2-extensions/datetime-picker","owner":"yii2-extensions","description":"DateTime picker.","archived":false,"fork":false,"pushed_at":"2024-08-16T14:47:50.000Z","size":53,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T08:06:04.930Z","etag":null,"topics":["datetime","datetimepicker","tempus","yii2","yii2-extensions"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yii2-extensions.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","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":"2023-11-23T08:58:16.000Z","updated_at":"2023-11-25T07:59:05.000Z","dependencies_parsed_at":"2023-11-24T23:21:05.724Z","dependency_job_id":"5159656a-f42b-44a2-91de-462e9c584fd4","html_url":"https://github.com/yii2-extensions/datetime-picker","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.15384615384615385","last_synced_commit":"3c11857547504b29926ffc1d9cb5b2307566d5b1"},"previous_names":["yii2-extensions/datetime-picker"],"tags_count":1,"template":false,"template_full_name":"yii2-extensions/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2-extensions%2Fdatetime-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2-extensions%2Fdatetime-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2-extensions%2Fdatetime-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yii2-extensions%2Fdatetime-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yii2-extensions","download_url":"https://codeload.github.com/yii2-extensions/datetime-picker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238174155,"owners_count":19428634,"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":["datetime","datetimepicker","tempus","yii2","yii2-extensions"],"created_at":"2024-09-24T13:36:34.771Z","updated_at":"2025-10-18T02:02:25.836Z","avatar_url":"https://github.com/yii2-extensions.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yii2-extensions/datetime-picker\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://www.yiiframework.com/image/yii_logo_light.svg\" height=\"100px;\"\u003e\n    \u003c/a\u003e\n    \u003ch1 align=\"center\"\u003eTempus Dominus Date/Time Picker.\u003c/h1\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.php.net/releases/8.1/en.php\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/PHP-%3E%3D8.1-787CB5\" alt=\"php-version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/yii2-extensions/datetime-picker/actions/workflows/build.yml\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/yii2-extensions/datetime-picker/actions/workflows/build.yml/badge.svg\" alt=\"PHPUnit\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/yii2-extensions/datetime-picker/actions/workflows/compatibility.yml\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://github.com/yii2-extensions/datetime-picker/actions/workflows/compatibility.yml/badge.svg\" alt=\"PHPUnit\"\u003e\n    \u003c/a\u003e    \n    \u003ca href=\"https://codecov.io/gh/yii2-extensions/datetime-picker\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/yii2-extensions/datetime-picker/branch/main/graph/badge.svg?token=MF0XUGVLYC\" alt=\"Codecov\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://dashboard.stryker-mutator.io/reports/github.com/yii2-extensions/datetime-picker/main\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyii2-extensions%2Fdatetime-picker%2Fmain\" alt=\"Infection\"\u003e\n    \u003c/a\u003e         \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/yii2-extensions/datetime-picker\" target=\"_blank\"\u003e\n        \u003cimg src=\"docs/images/datetime-picker.png\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Installation \n\nThe preferred way to install this extension is through [composer](https://getcomposer.org/download/).\n\nEither run\n\n```shell\ncomposer require --dev --prefer-dist yii2-extensions/datetime-picker:^0.1\n```\n\nor add\n\n```json\n\"yii2-extensions/datetime-picker\": \"^0.1\"\n```\n\nto the require section of your `composer.json` file.\n\n## Usage\n\n### Name\n\n```php\nuse Yii2\\Extensions\\DateTimePicker\\DateTimePicker;\n\necho DateTimePicker::widget(['name' =\u003e 'datetime-picker']);\n```\n\n### Active Field\n\n```php\nuse Yii2\\Extensions\\DateTimePicker\\DateTimePicker;\n\necho $form\n    -\u003efield($formModel, 'date')\n    -\u003ewidget(\n        DateTimePicker::class,\n        [\n            'icon' =\u003e Icon::renderIcon('solid', 'calendar', ['class' =\u003e 'me-2 fa-solid'])\n        ]\n    );\n```\n\n### Active Field Floating Label\n\n```php\nuse Yii2\\Extensions\\DateTimePicker\\DateTimePicker;\n\necho $form\n    -\u003efield($formModel, 'date', ['options' =\u003e ['class' =\u003e 'mt-3']])\n    -\u003elabel(false)\n    -\u003ewidget(\n        DateTimePicker::class,\n        [\n            'floatingLabel' =\u003e true,\n            'icon' =\u003e Icon::renderIcon('solid', 'calendar', ['class' =\u003e 'me-2 fa-solid'])\n        ]\n    )\n```\n\n### Dynamic Theme Configuration for tempusDominus Widget Library\n\nThis library provides functionality to dynamically configure the tempusDominus widget's theme based on user preferences or predefined settings.\n\n#### Functionality Overview\n\nThe library introduces a feature to automatically set up the tempusDominus widget with a theme determined by the user's preference or specified configurations.\n\n##### Automatic Theme Configuration\n\nUpon initialization, the library checks for theme configuration settings.\nIf the user has specified a theme in the library's configuration, it takes precedence.\n\n##### Browser-Based Theme Detection\n\nIf no specific theme is set or the attribute data-bs-theme is absent:\nThe library uses the prefers-color-scheme media query to detect the user's system preference for `light` or `dark` mode.\n\n##### Applying Theme Configuration to tempusDominus Widget\n\nThe library sets the theme configuration `(theme: 'dark' or theme: 'light')` based on the detected or specified theme.\nThis configuration is then applied to the tempusDominus widget using the library's internal functionalities.\n\n### Properties of the widget\n\n| Property         | Type          | Description                        | Default                     |\n|------------------|---------------|------------------------------------|-----------------------------|\n| `config`         | `array`       | The configuration of the widget.   | `[]`                        |\n| `containerClass` | `string`      | The class of the container.        | `input-group`               |\n| `cdn`            | `boolean`     | Whether to use the CDN.            | `true`                      |\n| `floatingLabel`  | `boolean`     | Whether to use the floating label. | `false`                     |\n| `format`         | `string`      | The format of the date.            | `yyyy/MM/dd HH:mm:ss`       |\n| `formatMonth`    | `string`      | The format of the month.           | `long`                      |\n| `formatYear`     | `string`      | The format of the year.            | `numeric`                   |\n| `icon`           | `string`      | The icon of the widget.            | `''`                        |\n| `id`             | `string`      | The ID of the widget.              | `datetimepicker1`           |\n| `labelClass`     | `string`      | The class of the label.            | `form-label`                |\n| `labelContent`   | `string`      | The content of the label.          | `''`                        |\n| `spanClass`      | `string`      | The class of the span.             | `input-group-text`          |\n| `startOfTheWeek` | `integer`     | The start of the week.             | `1`                         |\n| `template`       | `string`      | The template of the widget.         `'{label}\\n{input}\\n{span}'` |\n\n### Translation support\n\nThe extension supports translation. You can translate the extension into your language,\nfor default the extension supports the following languages.\n\n- Chinese\n- English\n- French\n- German\n- Portuguese\n- Russian\n- Spanish\n\n## Quality code\n\n[![static-analysis](https://github.com/yii2-extensions/datetime-picker/actions/workflows/static.yml/badge.svg)](https://github.com/yii2-extensions/datetime-picker/actions/workflows/static.yml)\n[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-7-blue)](https://github.com/yii2-extensions/datetime-picker/actions/workflows/static.yml)\n[![StyleCI](https://github.styleci.io/repos/722487175/shield?branch=main)](https://github.styleci.io/repos/722487175?branch=main)\n\n## Support versions Yii2\n\n[![Yii20](https://img.shields.io/badge/Yii2%20version-2.0-blue)](https://github.com/yiisoft/yii2/tree/2.0.49.3)\n[![Yii22](https://img.shields.io/badge/Yii2%20version-2.2-blue)](https://github.com/yiisoft/yii2/tree/2.2)\n\n## Testing\n\n[Check the documentation testing](docs/testing.md) to learn about testing.\n\n## Our social networks\n\n[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter\u0026logoColor=1DA1F2\u0026labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)\n\n## License\n\nThe MIT License. Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2-extensions%2Fdatetime-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyii2-extensions%2Fdatetime-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyii2-extensions%2Fdatetime-picker/lists"}