{ "info": { "author": "Pablo Escodebar", "author_email": "escodebar@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "# django-datetimepicker\n\nUses xdsoft's datetimepicker to make a datetimepicker widget for django.\nThis is inspired by the `django-bootstrap3-datetimepicker` application.\n\n![datetimepicker preview](https://cloud.githubusercontent.com/assets/26252388/24758585/1c485514-1ae3-11e7-8907-efe6db0155fd.png)\n\n## Installation\n\n- Run `pip install django-datetimepicker`\n- Add `'datetimepicker'` to your `INSTALLED_APPS`\n\n## Basic usage\n\nHere is an example of how to use the widget.\nFurther examples can be found in the example project.\n\n1. Assign the `DateTimePicker` to a `DateTimeField`, `DateField` or `TimeField`.\n\n```python\nfrom django import forms\nfrom datetimepicker.widgets import DateTimePicker\n\n\nclass SampleForm(forms.Form):\n\n datetime = forms.DateTimeField(\n widget=DateTimePicker(),\n )\n```\n\nThis will render the following `html` code:\n```html\n
\n\t\n
\n\n```\n\n## Passing options to `jQuery.datetimepicker`\n\nYou can add `jQuery.datetimepicker` options according to your needs.\n[See XDSoft's documentation for a full list of options.](http://xdsoft.net/jqplugins/datetimepicker/ \"XDSoft's DateTimePicker documentation.\")\n\n```python\n datetime = forms.DateTimeField(\n widget=DateTimePicker(options={\n\t 'format': '%Y-%m-%d %H:%M',\n\t 'language': 'en-us',\n\t}),\n )\n```\n\n## Customization with template overloading\n\n`django-datetimepicker` uses Django's own templating engine to render the field itself and the script tag needed to run it.\nThis allows to overload the templates to adapt the widget and javascript to your needs.\n\n- [`datetimepicker/div.html`](https://github.com/escodebar/django-datetimepicker/blob/master/datetimepicker/templates/datetimepicker/div.html)\n- [`datetimepicker/script.html`](https://github.com/escodebar/django-datetimepicker/blob/master/datetimepicker/templates/datetimepicker/div.html)\n- [`datetimepicker/loader.js`](https://github.com/escodebar/django-datetimepicker/blob/master/datetimepicker/templates/datetimepicker/loader.js)\n\n## Form javascript media\n\nAs seen in the basic example, a `